Web Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsWeb DesignWeb Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old November 18th, 2006, 08:12 AM
flabob flabob is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Nov 2006
Posts: 1 flabob User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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>

Reply With Quote
  #2  
Old November 19th, 2006, 05:22 PM
Mittineague's Avatar
Mittineague Mittineague is offline
Contributing User
Dev Articles Novice (500 - 999 posts)
 
Join Date: Jul 2005
Location: West Springfield, Massachusetts
Posts: 549 Mittineague User rank is Private First Class (20 - 50 Reputation Level)Mittineague User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 1 Week 1 Day 7 h 3 m
Reputation Power: 4
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" >&nbsp; &nbsp;  ASP Development</option>
<option value="43" class="fjdpth1" >&nbsp; &nbsp;  .NET Development</option>
<option value="48" class="fjdpth1" >&nbsp; &nbsp;  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.

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsWeb DesignWeb Development > Help with drop window in html for newbie


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway
Stay green...Green IT