<! Doctype HTML public "-// W3C // dtd html 4.0 transitional // en" >
< Html >
< Head >
< Title > New Document </ Title >
< Meta Name = "Generator" Content = "Editplus" >
< Meta Name = "Author" Content = "" >
< Meta Name = "Keywords" Content = "" >
< Meta Name = "Description" Content = "" >
<ScriptAng= "JavaScript">
Function Justnumbertext (){
If ( ! (Window. event. keycode > = 48 ) && (Window. event. keycode <= 57 )) | Window. event. keycode = 10 | Window. event. keycode = 13 )){
Window. event. keycode = 0 ;
Alert ("Enter a number!");Return False;
}
}
FunctionCheckcode (){
var value = event. keycode;
If ( ! (value 47 ) & (value 58 ) {
Alert ("Enter a number!");Return False;
}
}
</Script>
< Script Language = Javascript >
Function VIS ()
{
If (Isnan (form1.t1. Value ))
{
Alert ( ' The telephone number must be in digital format. ' )
Form1.t1. Focus ()
Return False
}
If (Form1.t1. value. Length > 11 )
{
Alert ( ' The telephone number should be 11 characters long. ' )
Form1.t1. Focus ()
Return False
}
}
</ Script >
</Head>
body >
form action = "? " method =" Post " name =" form1 " >
<InputName= "Txt1"Onchange= "If (/\ D /. test (this. value) {alert ('enter a number for the phone number '); this. value = ''; this. focus ()}">
<InputOnkeyup= "If (isnan (value) Execcommand ('undo ')"Onchange= "If (/\ D/. Test (this. Value) {alert ('only numbers allowed '); this. value = '';}">
<InputOnkeydown= "If (isnan (value) Execcommand ('undo ')"Onchange= "If (/\ D/. Test (this. Value) {alert ('only numbers allowed '); this. value = '';}">
<InputOnkeyup= "This. value = This. value. Replace (/\ D/g ,'')"Onafterpaste= "This. value = This. value. Replace (/\ D/g ,'')">
input onkeypress =" If (event. keycode <48 | event. keycode> 57) {alert ('phone number can only be entered number'); event. returnvalue = false;} " onkeyup =" this. value = This. value. replace (/[^ \ D *]/, '')" >
input onkeypress =" If (event. keycode <48 | event. keycode> 57) {alert ('phone number can only be entered number'); event. returnvalue = false;} " onpaste =" Return false; " onkeyup =" this. value = This. value. replace (/[^ \ D *]/, '')" >
<InputType= "Submit"Name= "Submit"Value= "Submit">
</Form>
</Body>
</Html>