1. Only numbers can be entered for verification input:
<MCE: Script Type = "text/JavaScript"> <! -- <Br/> function isnumberinput (event) // data type detection <br/>{< br/> var key, keychar; <br/> If (window. event) Key = Window. event. keycode; // receives keyboard input <br/> else if (event) Key = event. which; <br/> else return true; <br/> // check space and other special characters <br/> If (Key = NULL | key = 0 | key = 8 | key = 13 | | key = 27) <br/> return true; <br/> keychar = string. fromcharcode (key); <br/> If (// D /. test (keychar) {// check whether the input is a number. If yes, <br/> window is displayed. status = ""; <br/> return true; <br/>}< br/> else {<br/> window. status = "only digit input is allowed in this region"; // If the input is not a number, a prompt is displayed. <br/> return false; <br/>}</P> <p> // --> </MCE: SCRIPT>
2. The verification text box can only be Chinese Characters
// Method 1
<SCRIPT type = "text/JavaScript">
Function onlycanchina ()
{
VaR Re =/[^/u3447-/ufa29]/;
VaR value = Document. getelementbyid ("chinesetext"). value;
If (value = "") return;
If (myre. Test (value ))
{
Document. getelementbyid ("chinesetext"). value = "";
Alert ("Chinese only! ");
}
}
</SCRIPT>
// Method 2
<SCRIPT type = "text/JavaScript">
Function onlychinese (){
If (window. event. keycode >=32) & (window. event. keycode <= 126 )){
Window. event. keycode = 0;
}
}
</SCRIPT>
3. Add more tomorrow