• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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

 
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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....
 
Ranch Hand
Posts: 261
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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'.
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
 
reply
    Bookmark Topic Watch Topic
  • New Topic