我有一个 mvc4 Web 应用程序一个带有表单的页面
@using (Html.BeginForm()) {
@Html.ValidationSummary(true)
<fieldset>
<legend>News</legend>
<div class="editor-label">
@Html.LabelFor(model => model.title)
</div>
<div class="editor-field">
@Html.EditorFor(model => model.title)
@Html.ValidationMessageFor(model => model.title)
</div>
<div class="editor-label">
@Html.LabelFor(model => model.summery)
</div>
<div class="editor-field">
@Html.TextAreaFor(model => model.summery)
@Html.ValidationMessageFor(model => model.summery)
</div>
<p>
<input type="submit" value="Create" />
</p>
</fieldset>
}
我想在表单有效后调用一个显示确认对话框的函数(jquery)
$("#dialog-message").dialog({
modal: true,
resizable: false,
draggable: false,
title: title, closeOnEscape: false,
buttons: {
"OK submit": function () {
},
"Cancel Submit": function () {
}
}
});
这样做最好的方法是什么?我希望验证表单,如果有效则下一步显示确认消息,如果按下“确定提交”以提交表单,则下一步。