Note that there are some explanatory texts on larger screens.

plurals
  1. POsubmit two forms with one submit button jQuery
    text
    copied!<p>I have tried multiple ways of doing this, by searching on stackoverflow for the answer. </p> <p>I have two forms</p> <p>Form 1 basic setup:</p> <pre><code>&lt;form action="/post" class="frm-form" method="post" name="post" onsubmit="return vB_Editior['text_editor'].prepare_submit(0,0)" id="quick_reply"&gt; &lt;textarea&gt;&lt;/textarea&gt; &lt;input type="submit" name="post" value="Send"&gt; &lt;/form&gt; </code></pre> <p>Form 2 basic setup:</p> <pre><code>&lt;form enctype="multipart/form-data" id="tagnotif" style="display:none;" onsubmit="return vB_Editor['text_editor'].prepare_submit(0,0)" name="post2" method="post" action="/privmsg"&gt; &lt;input id="username" class="post" type="text" tabindex="1" size="25" name="username[]"style="margin:1px 0"&gt;&lt;br /&gt; &lt;input id="acpro_inp10" class="post" type="text" onkeypress="if (event.keyCode==13){return false}" title="" tabindex="2" maxlength="64" size="45" value="You have been tagged" name="subject"&gt;&lt;br /&gt; &lt;textarea id="textingnotification" rows="15" cols="9" name="message" tabindex="3"&gt;&lt;/textarea&gt; &lt;input type="hidden" value="" name="lt"&gt; &lt;input type="hidden" value="inbox" name="folder"&gt; &lt;input type="hidden" value="post" name="mode"&gt; &lt;/form&gt; </code></pre> <p>I just need these two forms to be submitted on SEND press of first form</p> <p>TRIED USING THIS CODE VARIABLES WITH THE MAIN SCRIPT: Though it won't pass both, and it won't refresh the page...</p> <pre><code>$(document).ready(function() { $('#quick_reply').ajaxForm(function() { alert("Thank you for your submitting form 1"); }); $('#tagnotif').ajaxForm(function() { alert("Thank you for your submitting form 2"); }); }); function mySubmitFunction() { $("#quick_reply").submit(); $("#tagnotif").submit(); } </code></pre>
 

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