|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Help with drop window in html for newbie
am new to learning html. I am trying to make a drop down window so ppl can choose an option..then go to the option they chose. I think i did the code right ,but i see the drop window with the options but when clicked ,it does not go to the choice that was made.. Here is the code i used and ill put my site im learning to make if anyone can help. I really appreciate it.. (URL address blocked: See forum rules) is my site..here is the code i used for my options drop window.Thx for any help
<CENTER> <select name="menu"><OPTION VALUE="(URL address blocked: See forum rules)/indexcomedy-family-kids.html">Comedy/family</option> <OPTION>ACTION/DRAMA <OPTION>SCI-FI/HORROR <OPTION>TV SERIES <OPTION>Westerns <OPTION>Bizzare-violent </SELECT><input type="button" onClick="location=document.jump1.menu.options[document.jump1.menu.selectedIndex].value;" value="GO"> </form> <br> </CENTER> |
|
#2
|
||||
|
||||
|
forum jump
Hi flabob, welcome to the forums,
In addition to online tutorials, one of the best ways to learn mark-up (albeit usually poor mark-up) is to find a page that has something that interests you and then "view-source" the page. For example, This page has a forum jump. When you view the source it shows Code:
<form action="forumdisplay.php" method="get"> <input type="hidden" name="s" value="" /> <input type="hidden" name="daysprune" value="" /> <strong>Forum Jump</strong><br /> <select name="f" onchange="this.form.submit();"> <optgroup label="Site Areas"> <option value="-1" >Please select one</option> <option value="cp" >User Control Panel</option> <option value="pm" >Private Messages</option> ......... <option value="-1">--------------------</option> </optgroup> <optgroup label="Forums"> <option value="7" class="fjdpth0" > Programming</option> <option value="3" class="fjdpth1" > ASP Development</option> <option value="43" class="fjdpth1" > .NET Development</option> <option value="48" class="fjdpth1" > PHP Development</option> ....... </optgroup> </select> <input type="submit" class="button" value="Go" /> </form> Notice that the option tags all have a value attribute and closing </option tags. Because it is a "jump" select, the select has an "onchange" event submit the form. But an onclick for the submit button could also submit the form. Your javascript is "inline" and is Code:
location=document.jump1.menu.options[document.jump1.menu.selectedIndex].value; This is looking for something named "jump1" that has a child element named "menu". Assuming your form is named "jump1", so far so good. But then it needs the selectedIndex's value. Only one of your options has a value, so only if that one is selected does it even have a chance of working. Last edited by Mittineague : November 19th, 2006 at 05:24 PM. |
![]() |
| Viewing: Dev Articles Community Forums > Web Design > Web Development > Help with drop window in html for newbie |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|