Este tema está marcado actualmente como "inactivo"—el último mensaje es de hace más de 90 días. Puedes reactivarlo escribiendo una respuesta.
1polomontana
I'm new to this and I am writing HtML code for a website I'm building.
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
I have my drop down menu set up but every time I hit submit it's directed to the same option.
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
I have my drop down menu set up but every time I hit submit it's directed to the same option.
2Noisy
Posting examples of HTML will be very difficult, because LT will see the first < and start looking for an entity that it recognises. You could try replacing all your < symbols with <. I don't know if <pre> works.
4jjwilson61
You could just replace all your angle brackets with squiggly brackets for the purpose of posting here.
6felius
You could use http://pastebin.com/ and post a link.
7wimble
If I'm understanding correctly:
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;
etc.
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;
etc.
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.
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;
etc.
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;
etc.
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.
8conceptDawg
Or use Javascript to handle the form click. But that's really getting into a whole other language that you don't want to deal with. But you asked. ;)
9wimble
> 8
True, I forgot the Javascript embellishment after the basic explanation. I've spent too many years writing server-side code, without relying on JS :)
True, I forgot the Javascript embellishment after the basic explanation. I've spent too many years writing server-side code, without relying on JS :)
10utoxin
For posting code examples for people to look at, I reccomend PasteBin: http://pastebin.com/