Note that there are some explanatory texts on larger screens.

plurals
  1. POcalling ColdFusion.Ajax.submitform() multiple times in a jQuery function
    text
    copied!<p>I have a page that has multiple forms on it. I then have a button that it has a jQuery click event handler attached to it that calls ColdFusion.Ajax.submitform() for each form. My problem is that the submitform() only works for some of the forms on the page. The rest of the forms do not get saved. To note: I can save all of the forms individually so I know that it is not a problem with my "form action" code.</p> <pre><code>&lt;script type="text/javascript"&gt; $(function() { $("#saveAll").click(function() { ColdFusion.Ajax.submitForm( 'form1', 'multipleforms.cfm' ); ColdFusion.Ajax.submitForm( 'form2', 'multipleforms.cfm' ); ColdFusion.Ajax.submitForm( 'form3', 'multipleforms.cfm' ); ColdFusion.Ajax.submitForm( 'form4', 'multipleforms.cfm' ); ColdFusion.Ajax.submitForm( 'form5', 'multipleforms.cfm' ); ColdFusion.Ajax.submitForm( 'form6', 'multipleforms.cfm' ); ColdFusion.Ajax.submitForm( 'form7', 'multipleforms.cfm' ); }); }); location.href = 'http://localhost/multipleforms.cfm'; &lt;/script&gt; </code></pre> <p>When I removed the 'location.href' line all the forms are saved. Does anybody know why that line would cause not all the forms to be saved? The reason 'location.href' is there is because I would like to refresh the page so that the user can see the data that is dependent on the values they picked in the form; and I don't want to use 'location.reload()' because it always produces a pop-up window confirming the reload. Also to note, I am trying to avoid using one big form to save the form data.</p> <p>Thanks.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload