Monday, July 7, 2014

Validate numeric field using javascript

The user input should always validated so that we can get correct and reliable data.

 For example, if you want user to input their age but if user inputs any letters then the system should not accept is as an input.


 Instead it should throw an error message telling user to correct its input. Below is the code which will validate a numeric field and gives error.
Enter Age: 

    

Now below is the javascript:
    



No comments:

Post a Comment