File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes HTML, CSS and JavaScript and the fly likes validating textfield with +ve/-ve values using 2 radiobuttons Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "validating textfield with +ve/-ve values using 2 radiobuttons" Watch "validating textfield with +ve/-ve values using 2 radiobuttons" New topic
Author

validating textfield with +ve/-ve values using 2 radiobuttons

soma lingam
Greenhorn

Joined: Apr 26, 2007
Posts: 19
In my jsp i had a textfield and 2 radio buttons
ie.,

Name of the textfield = pricePeriod
and two radio buttons : 1. Yes 2. No

By Default "pricePeriod = 0" and selected as "yes" Radio Button user has a mechanism to change the values
if i enter "Negative value" then "Yes" should be selected
if i change the value as "Positive value " in the textfield then "No" should be selected.
can anybody tell me how can i go further in this regard,

please, give me reply asap , urgent....
Anirvan Majumdar
Ranch Hand

Joined: Feb 22, 2005
Posts: 261
You can use the 'onBlur' event of the textfield to invoke a function which will check the textfield's value and accordingly set the 'checked' attribute of the corresponding radio button to 'true'.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61768
    
  67

Originally posted by soma lingam:
please, give me reply asap , urgent....

Please read this for information on why putting such phrases into your posts isn't a good idea.
[ February 06, 2008: Message edited by: Bear Bibeault ]

[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: validating textfield with +ve/-ve values using 2 radiobuttons