Note that there are some explanatory texts on larger screens.

plurals
  1. POJquery Modal window form - submitting two forms with one submission
    primarykey
    data
    text
    <p>I am trying to create a modal window form that submits two forms upon submission. One is a hidden form and the other is the modal window form being viewed. It only seems to be submitting one of the forms (reschedule_meeting_form) and just skips the other one entirely without an error. Any advice you can give is most appreciated.</p> <p><strong>Script:</strong></p> <pre><code>$(document).ready(function() { //creates a modal to post the new message being composed to the server $('#emailposting_form').dialog({ autoOpen: false, height: 375, width: 350, modal: true, buttons: [ { text: "Cancel", click: function() { $(this).dialog("close"); }}, { text: "Submit", click: function() { $('#emailform').submit(); //this one is not working $('#reschedule_meeting_form').submit(); //this one is working }} ] }); $('#reschedule_meeting_button').button().click(function(e){ $('#emailposting_form').dialog('open'); }); </code></pre> <p>});</p> <p><strong>Modal Form HTML:</strong></p> <pre><code> &lt;!-- modal form --&gt; &lt;div id="emailposting_form" title="Send Message"&gt; &lt;form id="emailform" method="POST" action="/sendemailmessage" name="emailposting"&gt; &lt;input type="text" style="display: none;" value="{{meeting_request.key()}}" id="reschedule_meeting_message" name="reschedule_meeting_message"&gt; &lt;p&gt; &lt;label for="recipient"&gt;To:&lt;/label&gt; &lt;input type="text" name="recipient" id="recipient" value="{{meeting_request.requesting_user}}" readonly&gt; &lt;/p&gt; &lt;p&gt; &lt;label for="subject"&gt;Subject: &lt;/label&gt; &lt;input type="text" name="subject" id="subject" value="Suggest New Meeting Time"&gt; &lt;/p&gt; &lt;p&gt; &lt;label for="content"&gt;Message: &lt;/label&gt; &lt;textarea name="content" id ="content" class="textarea" rows="4" style=""&gt;&lt;/textarea&gt; &lt;/p&gt; &lt;/form&gt; &lt;/div&gt; &lt;input type="button" id="reschedule_meeting_button" name="reschedule_meeting_button" value="Suggest New Meeting Time" &gt; </code></pre> <p><strong>Hidden Form HTML:</strong></p> <pre><code> &lt;form id="reschedule_meeting_form" method="POST" action="/meetingresponse" name="reschedule_meeting_form" style="display:none;"&gt; &lt;input type="text" style="display: none;" value="{{meeting_request.key()}}" name="reschedule_meeting"&gt; &lt;/form&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

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