How to get Radio button value in the same form

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Matsam
    New Member
    • Jun 2007
    • 33

    How to get Radio button value in the same form

    Hi,

    I have an ASP page that contains 3 radio buttons and a combo box.
    The combo box is to be populated depending on the option selected above. I am using Access DB. I want the value/checked status/on-off of the radio buttons to include a criteria in the where condition of the select query for populating the combo. How can I get its value (in the same page)?

    Thnks in advance

    Matsam
    .
  • jhardman
    Recognized Expert Specialist
    • Jan 2007
    • 3405

    #2
    Matsam,

    You can't. But there are some tricks you can use to make it look like you do.

    Trick 1: Open the db and make the three different versions of the drop-down box you could need, but hide them (<select ... style="visibili ty: hidden;">). Then when the radio button is clicked call a javascript function that un-hides the correct drop down box. (you will have to ask a javascript expert if you want better details than that, I could probably get it to work, but not without gruelling hours of tiresome trial and error)

    Trick 2: When the radio button is clicked, submit the form (<... onClick="this.f orm.submit()">) and then send them an exact duplicate of the form they had, but with everything that was filled out still filled out, and the appropriate drop down box made.

    I've seen both of these methods done successfully, the first uses more javascript and loads a little slower (and seems to be less-well supported cross-browser), the second method uses more asp and needs to be re-loaded every time you click the radio button.

    Jared

    Comment

    • Matsam
      New Member
      • Jun 2007
      • 33

      #3
      Originally posted by jhardman
      Matsam,

      You can't. But there are some tricks you can use to make it look like you do.

      Trick 1: Open the db and make the three different versions of the drop-down box you could need, but hide them (<select ... style="visibili ty: hidden;">). Then when the radio button is clicked call a javascript function that un-hides the correct drop down box. (you will have to ask a javascript expert if you want better details than that, I could probably get it to work, but not without gruelling hours of tiresome trial and error)

      Trick 2: When the radio button is clicked, submit the form (<... onClick="this.f orm.submit()">) and then send them an exact duplicate of the form they had, but with everything that was filled out still filled out, and the appropriate drop down box made.

      I've seen both of these methods done successfully, the first uses more javascript and loads a little slower (and seems to be less-well supported cross-browser), the second method uses more asp and needs to be re-loaded every time you click the radio button.

      Jared
      Hi

      Thanks for your help
      I used the 2nd method, as I am not good in Javascripts
      Thank you

      Matsam

      Comment

      Working...