我正在尝试创建一个模式窗口表单,在提交时提交两个表单。一个是隐藏窗体,另一个是正在查看的模态窗口窗体。它似乎只提交了一种形式(reschedule_meeting_form),并且完全跳过了另一种形式而没有错误。非常感谢您提供的任何建议。
脚本:
$(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');
});
});
模态表单 HTML:
<!-- modal form -->
<div id="emailposting_form" title="Send Message">
<form id="emailform" method="POST" action="/sendemailmessage" name="emailposting">
<input type="text" style="display: none;" value="{{meeting_request.key()}}" id="reschedule_meeting_message" name="reschedule_meeting_message">
<p>
<label for="recipient">To:</label>
<input type="text" name="recipient" id="recipient" value="{{meeting_request.requesting_user}}" readonly>
</p>
<p>
<label for="subject">Subject: </label>
<input type="text" name="subject" id="subject" value="Suggest New Meeting Time">
</p>
<p>
<label for="content">Message: </label>
<textarea name="content" id ="content" class="textarea" rows="4" style=""></textarea>
</p>
</form>
</div>
<input type="button" id="reschedule_meeting_button" name="reschedule_meeting_button" value="Suggest New Meeting Time" >
隐藏表单 HTML:
<form id="reschedule_meeting_form" method="POST" action="/meetingresponse" name="reschedule_meeting_form" style="display:none;">
<input type="text" style="display: none;" value="{{meeting_request.key()}}" name="reschedule_meeting">
</form>