Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to validate a text field with numeric value

 
geetu hindu
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
please tell me how to make it mandatory for a user to enter only Numeric value in a text field
 
Satish SN
Ranch Hand
Posts: 70
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,

u can find innumeral javascript validations for this u can straight away visit JavaScript.com good sight for these validations
 
Ram kanana
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Using java utility class
 
Akshayan Venkatesh
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Answer.

if you want only numeric value in the text box using this line

isNaN(parseInt(document.form.field.value)

whether form is a current form and field is which field to check...
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic