这是Java脚本。我试图传递的值是txtApplicationDate
但是价值没有达到服务器端 任何帮助将不胜感激
function ShowApplicationAttestationDialog() {
$("#ctl00_ctl00_MainContent_LoanMasterBodyContent_txtApplicationDate").datepicker();
$("#ApplicationDateDialog").dialog({
autoOpen: false,
modal: true,
title: "Application Attestation",
buttons: [
{
text: "Save",
click: function () {
$(this).dialog("close");
if ($("#ctl00_ctl00_MainContent_LoanMasterBodyContent_txtApplicationDate").val().length > 0)
{
$("#ctl00_ctl00_MainContent_LoanMasterBodyContent_btnContinue").click();
}
}
}
]
});
$("#ApplicationDateDialog").dialog("open");
return false;
}
这是标记。这是一个带有更新面板的aspx。 在页面加载时,我将onclick属性添加到提交按钮以调用上面提到的javascript函数
<div id="ApplicationDateDialog" style="display: none;">
<table>
<tr>
<td><span>The application date identified for this loan is :</span></td>
<td>
<asp:TextBox id="txtApplicationDate" runat="server" /></td>
</tr>
<tr>
<td>
<input type="checkbox" id="cbxConfirm" runat="server" /></td>
<td><span style="color: red;">I confirm this is the date the six points of data required to take a loan aplication was received.</span></td>
</tr>
</table>
</div>
</ContentTemplate>
</asp:UpdatePanel>
答案 0 :(得分:0)
更改代码并将其作为访问权限 来自$(&#34;#ctl00_ctl00_MainContent_LoanMasterBodyContent_txtApplicationDate&#34;)
到
$(&#39;#&lt;%= txtApplicationDate.ClientID%&gt;&#39;)。val()和
$(&#39;#&lt;%= cbxConfirm.ClientID%&gt;&#39;)。val()。您将获得在jQuery中访问的值。