开发者

how to check for null and non-number data enterd(like characters or special char)in to text box by using java script?

开发者 https://www.devze.com 2022-12-08 17:54 出处:网络
hi i have a page having text box. in that i should not allow user to go to next page unless he enters some NUMBER. it should numb开发者_如何转开发er but not text andshould not be empty , any help pls?

hi i have a page having text box. in that i should not allow user to go to next page unless he enters some NUMBER. it should numb开发者_如何转开发er but not text and should not be empty , any help pls?


Try this:

isNaN(yourText.value)

return true if its Not a Number


The title references checking for null, so you might also want to look at the null object in javascript.

0

精彩评论

暂无评论...
验证码 换一张
取 消