Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 8 of 8
  1. #1
    New Coder
    Join Date
    Nov 2010
    Posts
    50
    Thanks
    16
    Thanked 0 Times in 0 Posts

    Trying to work out how to populate a drop down list?

    I have a drop down list that I want to populate with items that are dependent on the selection of the first drop down list.

    I can't figure out how to do this, has anyone on here done this before?

    Cheers Dan
    Last edited by DanielHowden; 11-14-2010 at 03:52 PM.

  • #2
    Master Coder Excavator's Avatar
    Join Date
    Dec 2006
    Location
    Alaska
    Posts
    9,749
    Thanks
    22
    Thanked 1,838 Times in 1,822 Posts
    Hello DanielHowden,
    If you already have a dropdown working it must have menu items already. Just replace them with your own.

    Not much we can tell you without having a look at your code. I'm sure most people here have done a dropdown menu, they can be very difficult for a new coder.

    Post your code here and let us have a look. Even better, link us to the test site.
    Validate often DURING development - Use it like a splelchecker | Debug during Development |Write it for FireFox, ignore IE
    Use the right DocType | Validate your markup | Validate your CSS | Why validating is good | Why tables are bad

  • #3
    New Coder
    Join Date
    Nov 2010
    Posts
    50
    Thanks
    16
    Thanked 0 Times in 0 Posts
    Heres the code, I only didn't show it as I haven't got very far, just can't figure out how to do it!

    Cheers Dan.

    Code:
    <HTML><HEAD>
    
    </HEAD>
    
    <BODY>&nbsp;
    
    <select id=Items > 
    	<option value=01 selected>Opt1</option>
    	<option value=02>Opt2</option>
    	<option value=03>Opt3</option>
    	<option value=04>Opt4</option>
    </select>
    
    <select id=SecItems>
    	<option selected></option>
    </select>
    
    </BODY></HTML>

  • #4
    Master Coder Excavator's Avatar
    Join Date
    Dec 2006
    Location
    Alaska
    Posts
    9,749
    Thanks
    22
    Thanked 1,838 Times in 1,822 Posts
    I beleive options like that are an element of forms. I mistook your question to be about a menu, like navigation for a website.

    Are you following a tutorial to do this?
    Validate often DURING development - Use it like a splelchecker | Debug during Development |Write it for FireFox, ignore IE
    Use the right DocType | Validate your markup | Validate your CSS | Why validating is good | Why tables are bad

  • #5
    New Coder
    Join Date
    Nov 2010
    Posts
    50
    Thanks
    16
    Thanked 0 Times in 0 Posts
    No, I just teach myself and learn by mistakes. While I have done a lot of coding I am new to HTML. I am guessing that maybe I will have to run some kind of script to do this.

    Cheers Dan.

  • #6
    Master Coder Excavator's Avatar
    Join Date
    Dec 2006
    Location
    Alaska
    Posts
    9,749
    Thanks
    22
    Thanked 1,838 Times in 1,822 Posts
    That's a good way to learn, jsut dive in and do it. A good tutorial can help a lot too, google can probably help you with that.

    One thing to note, your document should have a valid DocType. I don't know if it does and you just didn't quote it here with your code...
    Have a look at the link about DocTypes in my signature line.
    Validate often DURING development - Use it like a splelchecker | Debug during Development |Write it for FireFox, ignore IE
    Use the right DocType | Validate your markup | Validate your CSS | Why validating is good | Why tables are bad

  • #7
    Master Coder Excavator's Avatar
    Join Date
    Dec 2006
    Location
    Alaska
    Posts
    9,749
    Thanks
    22
    Thanked 1,838 Times in 1,822 Posts
    An example of what you're attempting - http://www.java2s.com/Code/JavaScrip...ryprovince.htm
    Validate often DURING development - Use it like a splelchecker | Debug during Development |Write it for FireFox, ignore IE
    Use the right DocType | Validate your markup | Validate your CSS | Why validating is good | Why tables are bad

  • Users who have thanked Excavator for this post:

    DanielHowden (11-14-2010)

  • #8
    New Coder
    Join Date
    Nov 2010
    Posts
    50
    Thanks
    16
    Thanked 0 Times in 0 Posts
    That is great, just what I was wanting to do.

    Cheers Dan.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •