【发布时间】:2020-09-01 05:12:01
【问题描述】:
<asp:Button ID="btnSubmit" runat="server" style=" float:left" Text="Submit" `OnClientClick="submitRequest();" onclick="btnSubmit_Click" TabIndex="8"/>`
和
<script type="text/javascript">
function submitRequest() {
var hdn_YearlyAvailableFund = parseFloat("<%= hdnYearlyAvailableFund.Value %>");
var hdn_Amount = parseFloat("<%= hdnAmount.Value %>");
var hdn_QueryString = "<%= hdnQueryString.Value %>";
var approve = document.getElementById("<%=rdbApprove.ClientID %>");
var check = approve.checked;
if (hdn_QueryString.toString() == 'X') {
if (approve.checked == true) {
if (hdn_YearlyAvailableFund < hdn_Amount) {
alert('Yearly available fund is less than Requested Amount, Cannot approve...!')
}
else {
if (confirm('Are you sure want to update this request?'))
document.getElementById('<%= btnSubmit.ClientID %>').click();
}
}
}
else {
if (confirm('Are you sure want to update this request?')) {
document.getElementById('<%= btnSubmit.ClientID %>').click();
}
}
}
</script>
在我的代码中,警报和确认方法没有一起工作。
我请求给我一个解决方案。提前致谢。
【问题讨论】:
标签: javascript asp.net onclick onclientclick