Este tema está marcado actualmente como "inactivo"—el último mensaje es de hace más de 90 días. Puedes reactivarlo escribiendo una respuesta.
I have the drop down window but how do you direct the selections in the drop down menu to different destinations?
I'm stuck on my form, action line and my drop down menu works but only for the one option in my action line.
So when option A or option B are picked in the drop down menu, if the person hits A or B, how can I direct them to different destinations?
Do I take out my action line?
Thanks in advance.
Just a quick example of what I'm saying.
I have my drop down menu set up but every time I hit submit it's directed to the same option.
You've got an HTML form, with an action.
Within that form you've got a select list, with multiple options.
You want to send the user to a different URL according to the option they select from the list?
You can't do it (is the technically correct answer).
What you can do is put a switch (or series of if branches) in the one thing they get directed to, which renders entirely different HTML, according to the selected option:
IF option='A' THEN draw_page_1;
ELSIF option='B' THEN draw_page_2;
What you can do though, is include HTML redirection on each of those pages (See http://en.wikipedia.org/wiki/URL_redirection#Techniques for the technicalities). What then happens is that the user initially comes to your one available action, and the above code is replaced with:
IF option='A' THEN redirect_to_page_1;
ELSIF option='B' THEN redirect_to_page_2;
After which the user is redirected to the appropriate ultimate page. This does get more complicated if you want to preserve other values they passed with the form though.