zoukankan      html  css  js  c++  java
  • ajaxSubmit提交

    //submit   
            $('#formInfo1').submit(function(){  
                    if(!submitCheck()){  
                        return false;  
                    }  
                    try{  
                        var formInfo = document.all('formInfo1');  
                        if(Validator.Validate(formInfo,1)){  
                            if(postUrl == "new"){  
                                $('#formInfo1').ajaxSubmit(ajaxOptionsNew);  
                            }else {  
                                $('#formInfo1').ajaxSubmit(ajaxOptionsEdit);  
                            }  
                              
                        }  
                    }catch(e){alert('submit:'+e.message);}  
                    return false;  
            });  
              
            var ajaxOptionsEdit = {  
                    beforeSubmit : showRequest,  
                    success : showResponse,  
                    url : "flowcharSet!toUpdateProcessField.action",  
                    error : function(XMLResponse) {  
                        //alert(XMLResponse.responseText);   
                        alert('操作失败!');  
                            document.all('formInfo1').reset();  
                            parent.queryForm.submit();  
                            closeDialogInIframe();  
                    }  
                };  
            var ajaxOptionsNew = {  
                    beforeSubmit : showRequest,  
                    success : showResponse,  
                    url : "flowcharSet!addProcessInfo.action",  
                    error : function(XMLResponse) {  
                        //alert(XMLResponse.responseText);   
                        alert('操作失败!');  
                            document.all('formInfo1').reset();  
                            parent.queryForm.submit();  
                            closeDialogInIframe();  
                    }  
                };  
              
            function showRequest() {  
                    setBufftonDisabled(true);  
                    return true;  
            }  
                  
            function showResponse(responseText) {  
                    try{  
                        setBufftonDisabled(false);  
                        if(responseText == '<%=DataStaticConstants.SUCCESS_MESSAGE%>'){  
                            alert('操作成功!');  
                            document.all('formInfo1').reset();  
                            parent.getProcessInfo();  
                            closeDialogInIframe();  
                        }else{  
                            alert('操作失败!');  
                        }  
                    }catch(e){alert(e.message);}  
            }  
    
    //submit
            $('#formInfo1').submit(function(){
                    if(!submitCheck()){
                        return false;
                    }
                    try{
                        var formInfo = document.all('formInfo1');
                        if(Validator.Validate(formInfo,1)){
                            if(postUrl == "new"){
                                $('#formInfo1').ajaxSubmit(ajaxOptionsNew);
                            }else {
                                $('#formInfo1').ajaxSubmit(ajaxOptionsEdit);
                            }
                            
                        }
                    }catch(e){alert('submit:'+e.message);}
                    return false;
            });
            
            var ajaxOptionsEdit = {
                    beforeSubmit : showRequest,
                    success : showResponse,
                    url : "flowcharSet!toUpdateProcessField.action",
                    error : function(XMLResponse) {
                        //alert(XMLResponse.responseText);
                        alert('操作失败!');
                            document.all('formInfo1').reset();
                            parent.queryForm.submit();
                            closeDialogInIframe();
                    }
                };
            var ajaxOptionsNew = {
                    beforeSubmit : showRequest,
                    success : showResponse,
                    url : "flowcharSet!addProcessInfo.action",
                    error : function(XMLResponse) {
                        //alert(XMLResponse.responseText);
                        alert('操作失败!');
                            document.all('formInfo1').reset();
                            parent.queryForm.submit();
                            closeDialogInIframe();
                    }
                };
            
            function showRequest() {
                    setBufftonDisabled(true);
                    return true;
            }
                
            function showResponse(responseText) {
                    try{
                        setBufftonDisabled(false);
                        if(responseText == '<%=DataStaticConstants.SUCCESS_MESSAGE%>'){
                            alert('操作成功!');
                            document.all('formInfo1').reset();
                            parent.getProcessInfo();
                            closeDialogInIframe();
                        }else{
                            alert('操作失败!');
                        }
                    }catch(e){alert(e.message);}
            }
    function setBufftonDisabled(flag) {  
        var inputs = document.getElementsByTagName("input");  
        for ( var i = 0; i < inputs.length; i++) {  
            if (inputs[i].type == "button" || inputs[i].type == "submit") {  
                inputs[i].disabled = flag;  
            }  
        }  
    } 
  • 相关阅读:
    滑动拼图
    CentOS8安装中文输入法
    windows+ubuntu 双系统时间不一致的问题
    Goland 2019下载和安装(带破解补丁和汉化包)
    防火墙站名资源脚本
    linux上以服务方式启动程序kestrel
    NLog实践记录
    sqlserver安装ubuntu
    pyspark提交集群任务
    无法打开hadoop的UI页面
  • 原文地址:https://www.cnblogs.com/shenyixin/p/2739289.html
Copyright © 2011-2022 走看看