Win a copy of Design for the Mind this week in the Design forum!
    Bookmark Topic Watch Topic
  • New Topic

validation of input field

 
Makhana Jiggu
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Report post to moderator
I need to validate a field to allow only decimal values
eg 10.2 or 10.0 or 10 is acceptable
It can have only 2 digits before the decimal point and can have only one digit after the decimal point. How can i check this.
Any sample code is helpful
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Report post to moderator
Duplicate of:
http://www.coderanch.com/t/116820/HTML-JavaScript/java-script-validate-decimal-point

The question has been answered in the other thread.
In the future, please don't post the same question to multiple forums.
This is called cross-posting and is considered to be very rude.
It wastes the time of the people who are trying to help you.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64692
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Report post to moderator
"Buff",

There aren't may rules that you need to worry about here on the Ranch, but one that we take very seriously regards the use of proper names. Please take a look at the JavaRanch Naming Policy and adjust your display name to match it.

In particular, your display name must be a first and a last name separated by a space character, and must not be obviously fictitious.

Thanks!
bear
Forum Bartender
 
    Bookmark Topic Watch Topic
  • New Topic