1, red is input text can only enter numbers and decimal points.
<input type= "text" class= "input" name= "rate" value= "0.000"onkeypress= "if (!this.value.match (/^[\+\-]?\d*?\.? \d*?$/)) This.value=this.t_value;else this.t_value=this.value;if (This.value.match (?: [/^ (?: \. \d+)?)? $/)) This.o_value=this.value "onkeyup=" if (!this.value.match (/^[\+\-]?\d*?\.? \d*?$/)) This.value=this.t_value;else this.t_value=this.value;if (This.value.match (?: [/^ (?: \. \d+)?)? $/)) This.o_value=this.value "onblur=" if (!this.value.match (?: [/^ (?: \). \d+)? | \.\d*?)? $/) this.value=this.o_value;else{if (This.value.match (/^\.\d+$/)) this.value=0+this.value;if (This.value.match (/^ \.$/)) This.value=0;this.o_value=this.value} " />
2, red is input text can only enter numbers and letters.
<input type= "text" class= "input" name= "SYMBOLASC" onkeyup= "Value=value.replace (/[\w]/g, ')" onbeforepaste= " Clipboarddata.setdata (' Text ', Clipboarddata.getdata (' text '). Replace (/[^\d]/g, ') "/>
Restrict input text input type (number, letter, decimal point)