tags:

views:

16

answers:

1

Hi all.. 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

+2  A: 

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.

Vinay Pandey
`<` should be `<=` I guess.
Salman A