wood burning stoves 2.0*
The moose likes HTML, CSS and JavaScript and the fly likes Validation of Forms Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Validation of Forms" Watch "Validation of Forms" New topic
Author

Validation of Forms

Paddy Joshi
Greenhorn

Joined: Oct 13, 2010
Posts: 10
Hi,
I want to validate a form. In which i need to validate if user entered text where number is required. i come to know about isNaN () method. but it will validate floating numbers also and i want integers only. moreover how can i enable a text input only when checkbox is enabled
what i did was ( for number validation)


please help me with this ... thnks in advance ...
Prasad Krishnegowda
Ranch Hand

Joined: Apr 25, 2010
Posts: 513

You can try using regular expressions..


Regards, Prasad
SCJP 5 (93%)
Prasad Krishnegowda
Ranch Hand

Joined: Apr 25, 2010
Posts: 513

Paddy Joshi wrote:how can i enable a text input only when checkbox is enabled

On click of the checkbox, call one function, based on the value you get from checkbox(whether its checked or unchecked), enable/disable a text box. What difficulty are you facing here?
Seetharaman Venkatasamy
Ranch Hand

Joined: Jan 28, 2008
Posts: 5575

your logic looks fine for me except .(dot) in your string . remove that!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Validation of Forms