• Post Reply Bookmark Topic Watch Topic
  • New Topic

how to validate a text field with numeric value  RSS feed

 
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
 
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
 
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Using java utility class
 
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...
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!