62,243
社区成员




<script type="text/javascript">
function checkPost()
{
var numOne=parseInt(document.getElementById('<%= TextBox1.ClientID %>').value);
var numTwo=parseInt(document.getElementById('<%= TextBox2.ClientID %>').value);
if(isNaN(numOne)||isNaN(numTwo))
{
alert('请填数字');
return false;
}
return numOne > numTwo ? true : confirm('是否继续');
}
</script>
<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
<asp:TextBox ID="TextBox2" runat="server"></asp:TextBox>
<asp:Button ID="Button1" runat="server" Text="Button1" OnClientClick="return checkPost();" OnClick="Button1_Click" />
protected void Button1_Click(object sender, EventArgs e)
{
Insert();
}
function check() {
var txt1 = document.getElementById("<%= TextBox1.ClientID %>");
var txt2 = document.getElementById("<%= TextBox2.ClientID %>");
if (txt1.value == "" || txt2.value == "") {
alert("不能为空");
return false;
}
return txt1.value >= txt2.value ? true : confirm('是否继续');
}
<script type="text/javascript">
function check() {
if (document.getElementById('<%= TextBox1.ClientID %>').value >= document.getElementById('<%= TextBox2.ClientID %>').value)
return true;
else
return confirm('是否继续');
}
</script>
<asp:Button ID="Button1" runat="server" Text="Button1" OnClick="Button1_Click" OnClientClick="check()" />
protected void Button1_Click(object sender, EventArgs e)
{
Insert();
}