Hi sir,
I validate the mobileno by accepting only numeric in textbox. It's working fine in internet Explorer but it is not validated in
Mozilla firefox. Kindly give me the solution for this problem. I attached the code below for the reference.
Default3.aspx:
*******************************
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default3.aspx.cs" Inherits="Default3" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<script language="vbscript" type="text/vbscript">
function num()
if (window.event.keyCode>=48 and window.event.keyCode<=57) or (window.event.keyCode=44) then
window.event.keyCode=window.event.keyCode
else
window.event.keyCode=0
end if
end function
</script>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:Label ID="Label1" runat="server" Text="Enter the Mobile No. "></asp:Label>
<asp:TextBox ID="TextBox1" runat="server" MaxLength="10" onkeypress="num()" Width="119px"></asp:TextBox>
<asp:Button ID="Button1" runat="server" Text="Submit" />
</div>
</form>
</body>
</html>
With regards,
J.Prabu.
[Email:prbspark@gmail.com]