File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
soma lingam
Greenhorn
Posts: 22
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 261
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 64188
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic