< script type="text/javascript" language="javascript" >
String.prototype.startsWith = function (str)
{
return (this.indexOf(str) === 0);
}
function ValidationofPaymentAmount{
var txtNo = document.getElementById("txtNumber").value;
if (txtNo .startsWith(".") || txtNo.startsWith("0")) // true
{
document.getElementById("txtNumber").value = "";
alert("you can not insert dot and zero as first character");
}
}
< /script>
In code Behind:
<asp:TextBox ID="txtNumber" runat="server" onkeyup="ValidationofPaymentAmount();"></asp:TextBox>
No comments:
Post a Comment