views:

79

answers:

1

Excuse my lack of html knowledge, but is it possible to set up a set of say 3 radio buttons so that each one links to a different select list of items?

What I'm trying to do is let the user select either:

Projects select list of all the projects,
Tasks select list of all the tasks,
Users select list of all the users

As far as I have been able to figure from radio buttons so far, they just display text and have a submit value as an input. Is what I'm thinking of infeasible?

I'm kind of hoping there is some plain easy way to link the radio button to each select list, but I can in the worst case imagine just having the appropriate select list place its value into the radio button's value field via a javascript method. That just seems unnecessarily complicated though for what seems like such a simple idea.

+1  A: 

You would certainly need to use javascript to accomplish this; plain HTML radiobuttons are merely intended to transmit a single value in a form submission.

To clarify what you're asking for, is this what you had in mind:

  1. user starts with set of 3 radio buttons indicating which type of selection they want to make
  2. user selects one of the buttons
  3. user sees a select list for the appropriate type of item

If this is what you mean, the easiest way to do this is to simply add all three select lists, but have them hidden. Then add a javascript event to the radio buttons to show the selected one (and hide the others if necessary).

JacobM
Yea that's a reasonable solution. It doesn't really matter if the select lists are hidden or not, but rather that only the values of the appropriate select list are handled
Rich