/* * jQuery Form Plugin * version: 2.67 (12-MAR-2011) * @requires jQuery v1.3.2 or later * * Examples and documentation at: http://malsup.com/jquery/form/ * Dual licensed under the MIT and GPL licenses: * http://www.opensource.org/licenses/mit-license.php * http://www.gnu.org/licenses/gpl.html */ (function(B){B.fn.ajaxSubmit=function(C){if(!this.length){A("ajaxSubmit: skipping submit process - no element selected");return this}if(typeof C=="function"){C={success:C}}var F=this.attr("action");var H=(typeof F==="string")?B.trim(F):"";if(H){H=(H.match(/^([^#]+)/)||[])[1]}H=H||window.location.href||"";C=B.extend(true,{url:H,type:this[0].getAttribute("method")||"GET",iframeSrc:/^https/i.test(window.location.href||"")?"javascript:false":"about:blank"},C);var O={};this.trigger("form-pre-serialize",[this,C,O]);if(O.veto){A("ajaxSubmit: submit vetoed via form-pre-serialize trigger");return this}if(C.beforeSerialize&&C.beforeSerialize(this,C)===false){A("ajaxSubmit: submit aborted via beforeSerialize callback");return this}var G,Q,I=this.formToArray(C.semantic);if(C.data){C.extraData=C.data;for(G in C.data){if(C.data[G] instanceof Array){for(var D in C.data[G]){I.push({name:G,value:C.data[G][D]})}}else{Q=C.data[G];Q=B.isFunction(Q)?Q():Q;I.push({name:G,value:Q})}}}if(C.beforeSubmit&&C.beforeSubmit(I,this,C)===false){A("ajaxSubmit: submit aborted via beforeSubmit callback");return this}this.trigger("form-submit-validate",[I,this,C,O]);if(O.veto){A("ajaxSubmit: submit vetoed via form-submit-validate trigger");return this}var M=B.param(I);if(C.type.toUpperCase()=="GET"){C.url+=(C.url.indexOf("?")>=0?"&":"?")+M;C.data=null}else{C.data=M}var K=this,J=[];if(C.resetForm){J.push(function(){K.resetForm()})}if(C.clearForm){J.push(function(){K.clearForm()})}if(!C.dataType&&C.target){var N=C.success||function(){};J.push(function(T){var S=C.replaceTarget?"replaceWith":"html";B(C.target)[S](T).each(N,arguments)})}else{if(C.success){J.push(C.success)}}C.success=function(X,T,W){var S=C.context||C;for(var U=0,V=J.length;U0;var L="multipart/form-data";var R=(K.attr("enctype")==L||K.attr("encoding")==L);if(C.iframe!==false&&(P||C.iframe||R)){if(C.closeKeepAlive){B.get(C.closeKeepAlive,E)}else{E()}}else{B.ajax(C)}this.trigger("form-submit-notify",[this,C]);return this;function E(){var Y=K[0];if(B(":input[name=submit],:input[id=submit]",Y).length){alert('Error: Form elements must not have name or id of "submit".');return}var X=B.extend(true,{},B.ajaxSettings,C);X.context=X.context||X;var V="jqFormIO"+(new Date().getTime()),c="_"+V;var W=B('