我正在根据下拉菜单将不同的表单加载到同一个 div 中……当他们被告知通过 JQuery 提交时,所有其他表单似乎都可以工作,除了这个……有人知道为什么吗?谢谢....
@using (Html.BeginForm("SaveInMemoryPayment", "Payment", FormMethod.Post))
{
@Html.ValidationSummary(true)
<p> Payment type: Cash. No further action needed. Plase click Save to finish. </p>
<input type="hidden" name="PaymentTypeID" id="paymentTypeIDHidden" value="@Model.PaymentTypeID" />
<input type="hidden" name="DonationID" id="donationIDHidden" value="@Model.DonationID" />
<input type="hidden" name="PaymentDate" id="paymentDateHidden" value="@Model.PaymentDate" />
<input type="hidden" name="PaymentAmount" id="paymentAmountHidden" value="@Model.PaymentAmount" />
}
这是一个有效的表格......
@using (Html.BeginForm("SaveInMemoryPayment", "Payment", FormMethod.Post))
{
@Html.ValidationSummary(true)
<p>Check information:</p>
<div class="editor-label" id="check1">
@Html.LabelFor(model => model.CheckNumber)
</div>
<div class="editor-field" id="check1.2">
@Html.EditorFor(model => model.CheckNumber)
@Html.ValidationMessageFor(model => model.CheckNumber)
</div>
@Html.HiddenFor(x => x.PaymentTypeID)
@Html.HiddenFor(x => x.DonationID)
@Html.HiddenFor(x => x.PaymentDate)
@Html.HiddenFor(x => x.PaymentAmount)
}
他们都发回同一个地方……但第一个不会。这些表单被加载到具有保存按钮的父视图中的 div 中...该按钮打开一个对话框,单击时有一个 OK 按钮:$('#paymentSection2').find('form') 。提交();