开发者

max marks validation

开发者 https://www.devze.com 2023-01-19 22:50 出处:网络
i have some problem in javascript validation..开发者_运维百科. My requirement is user sholud enter value in text box less than 5

i have some problem in javascript validation..开发者_运维百科. My requirement is user sholud enter value in text box less than 5 he sholud not allow to enter value which is more than 5 he can enter 4.25 3.10 he should not enter 5.1 how to restrict user not to do this.. what is code for this.on which event we sholud call it


you can use onBlur event of textbox and then use

if(parseFloat(yourValue)<=limit)

Also you can use isNaN(yourValue) to check if it is a number.

0

精彩评论

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