正文

Textbox Validation

(2007-10-24 20:22:56) 下一個



<............onKeyDown="var lilKey=event.keyCode; if(lilKey==48){return true} else if(lilKey >=49&&lilKey<=57){return true}else{alert('Numbers only!');return false;}">





Drag a textbox onto aspx page, copy and paste onKeyDown event. This will validate your input to the textbox and only numbers can be entered into the textbox not characters. Try it.
















[ 打印 ]
閱讀 ()評論 (0)
評論
目前還沒有任何評論
登錄後才可評論.