Link: http://fus53.blog.163.com/blog/static/73588615200891712311647/
<Script language = JavaScript>
Function onlyeng ()
{
If (! (Event. keycode> = 65 & event. keycode <= 90 ))
Event. returnvalue = false;
}
Function onlynum ()
{
If (! (Event. keycode> = 48 & event. keycode <= 57) | (event. keycode> = 96 & event. keycode <= 105 )))
// Consider Number Key
Event. returnvalue = false;
}
Function isemail (stremail ){
If (stremail. search (/^ \ W + (-\ W +) | (\. \ W +) * \ @ [A-Za-z0-9] + ((\. |-) [A-Za-z0-9] + )*\. [A-Za-z0-9] + $ /)! =-1)
Return true;
Else
Alert ("oh ");
}
</SCRIPT>
<Div align = "center">
<Center>
<Table border = "1" width = "90%" cellspacing = "0" cellpadding = "0" style = "font-size: 12px "bordercolor =" #000000 "bordercolorlight =" #000000 "bordercolordark =" # ffffff ">
<Tr>
<TD width = "100%"> only Chinese characters: <input onkeyup = "value = value. replace (/[^ \ u4e00-\ u9fa5]/g, '')"> </TD>
</Tr>
<Tr>
<TD width = "100%"> Yes only English Character: <input onkeydown = "onlyeng ();"> </TD>
</Tr>
<Tr>
<TD width = "100%"> only numbers are allowed: <input onkeydown = "onlynum ();"> </TD>
</Tr>
<Tr>
<TD width = "100%"> Yes only English Letters and numbers: <input onkeyup = "value = value. replace (/[\ W]/g, '')" onbeforepaste = "clipboardData. setdata ('text', clipboardData. getdata ('text '). replace (/[^ \ D]/g, '')"> </TD>
</Tr>
<Tr>
<TD width = "100%"> verification email format: <input type = text onblur = isemail (this. Value)> </TD>
</Tr>
<Tr>
<TD width = "100%"> do not enter Chinese characters <input onpaste = "Return false;" style = "IME-MODE: Disabled; width: 400px" value = "I only accept English input! Thanks for corporation! "Name = textfield> </TD>
</Tr>