• 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;  
            }  
        }  
    } 
  • 相关阅读:
    常用工具类
    手机端加载中
    jeecg的各种坑
    资源
    idea 破解后无法启动,我的配置文件搞错了
    eclipse xml 报某某.xsd找不到
    linux上部署svn服务器
    苹果手机微信浏览器无法通过post提交form数据
    %%%
    AtCoder arc060_d
  • 原文地址:https://www.cnblogs.com/shenyixin/p/2739289.html
Copyright © 2020-2023  润新知