表达能力有限,只供代码,自己体会
文件Past.js
functionCheckBox()
{
if(confirm('充值手机:['+document.MobileCommit.TextBox1.value+']充值金额:['+document.MobileCommit.TextBox2.value+']元确认充值!')==false)
returnfalse;
MobileCommit.Button1.disabled=true;//禁止button1
MobileCommit.Button2.disabled=true;
__doPostBack('Button1','');//用__doPostBack提交
}
在页面文件Mobile.aspx里加一个
<scriptsrc="js/Past.js"language="javascript"></script>
接下来是Mobile.cs
privatevoidPage_Load(objectsender,System.EventArgse)
{
this.GetPostBackEventReference(this.Button1);
Button1.Attributes.Add("onclick","returnCheckBox()");
}
你们可以照此方法测试
文件Past.js
functionCheckBox()
{
if(confirm('充值手机:['+document.MobileCommit.TextBox1.value+']充值金额:['+document.MobileCommit.TextBox2.value+']元确认充值!')==false)
returnfalse;
MobileCommit.Button1.disabled=true;//禁止button1
MobileCommit.Button2.disabled=true;
__doPostBack('Button1','');//用__doPostBack提交
}
在页面文件Mobile.aspx里加一个
<scriptsrc="js/Past.js"language="javascript"></script>
接下来是Mobile.cs
privatevoidPage_Load(objectsender,System.EventArgse)
{
this.GetPostBackEventReference(this.Button1);
Button1.Attributes.Add("onclick","returnCheckBox()");
}
你们可以照此方法测试
本文提供了一个使用JavaScript实现的充值确认对话框示例代码。该示例展示了如何通过简单的前端交互来确认用户的充值行为,并禁用提交按钮直到确认完成。代码适用于网页应用中的充值流程。
2131

被折叠的 条评论
为什么被折叠?



