客户端验证不起作用? [英] client side validation not working?
本文介绍了客户端验证不起作用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
var amntrec1 = document.getElementById('<%=txtAmountRec.ClientID%>');
if(amntrec1.value > 0) {
var recdate = document.getElementById('<%=txtrecdate.ClientID%>');
if (recdate.value == "") {
alert("Must Enter Received date");
return false;
}
return false;
}
是否正确?如果我编写此代码,验证后不是解雇?
is it correct ?if i write this code,after validation is not fired?
推荐答案
function valid()
{
var amntrec1 = document.getElementById(TextboxID);
if(amntrec1.value 0) {
var recdate = document.getElementById(TextboxID);
if (recdate.value == "") {
alert("Must Enter Received date");
return false;
}
return false;
}
}
//call from Button
<asp:Button ID="btn_Login" runat="server" Text="Login"
onclick="btn_Login_Click" OnClientClick="return valid();" />
这篇关于客户端验证不起作用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文