May 31, 2009

0 Javascript Telephone Number Validation

well this is a script for users who want to make only nos javascript validation box, with this script u can allow only nos in text box and no other characters except nos from 0-9,

if a users puts any other characters except nos, then it will give an error only nos with an alert box. this is an handy script for telephone nos validation script.



<script language="javascript">

function check()
{

var a=document.f1.a1.value
if (document.f1.a1.value=="")
{
alert ("write nos")
return false;
}
if (a/a!=1 && a!=0)
{
alert ("only nos")
return false;
}
}
</script>
<body>
<form name="f1" onSubmit="return check()">
<input type="txt" name="a1">
<input type="submit" value="submit">
</form>
</body>

0 comments:

Post a Comment

Blogger Themes

 
Powered by Blogger