Dojo double submittion -


Yes! I can not understand it myself!

The following is a form that is dynamically loaded into a content provider called 'Content Companie Type' when the submit button is clicked to submit the form using AJAX firefox firebug, then the form Has been presented twice. Once successful and second time the form is not valid.

I have set the first retired page (success page) in just plain text, so I know that double submission is coming from this page / code. / P>

  & lt; Script language = "javascript" & gt; Var human = 0; Dojo.parser.parse (dojo.byId ('CompanyTypeForm')); Dojo.addOnLoad (function () {// Select the type of company if Digit.IID ('Company typed selection).' Set ('value', string (1)); // Ajax is the type of company var DijitCT = dijit.byD Dojo.connect (dijitCT, "onClick", function () {human = 1}}; dojo.connect (dijitCT, "onChange", function () {if (human) {var ctNum = dijitct set ( "Href", "company type /" + ctNum + "/");}}); // AJAX form submission var formname = dojo.byId ("('value'); dijit.byId ('ContentCompanyType') (form : Dojo.byId ("CompanyTypeForm"), // Handles: "text", load: Function (data) {console.log ('submitted'); dojo.byId ("ContentCompanyType"). InnerHTML = data;}, error : Functions Call (error) {dojo.byId ("errorMessage"). InnerHTML = error;}} // asynchronous xhrPost dojo.byId ("ContentCompanyType2"). InnerHTML = "Sending the form ..." var deferred = Dojo.xhrPost (xhrArgs);}}}}); / script>  
& Lt; Button dojoType = "dijit.form.Button" type = "submit" name = "submit button" value = "submit" & gt; Update & lt; / Button & gt; & Lt; / Form & gt;

You have an HTML form with a submit button. This will trigger an HTML without dojo. You are also adding code to an on-suite event that runs your logic with an azer. Dojo.connect does not replace the code, it only triggers that method when that method is called, then both things are designed to work.

You may want to define an on-suite method here that is a no-op or just calls your method.

Comments

Popular posts from this blog

mysql - BLOB/TEXT column 'value' used in key specification without a key length -

c# - Using Vici cool Storage with monodroid -

python - referencing a variable in another function? -