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 3 of 3
  1. #1
    New Coder
    Join Date
    Nov 2010
    Posts
    50
    Thanks
    16
    Thanked 0 Times in 0 Posts

    Setting up an Option Group in JavaScript?

    So this is how I setup an item in the list and it works fine but I can't fine the syntax for setting an option group in javascript.

    Cheers Daniel.

    Code:
    Users[0] = new Option("Text to show in list", "Item Value");

  • #2
    Senior Coder Logic Ali's Avatar
    Join Date
    Sep 2010
    Location
    London
    Posts
    1,028
    Thanks
    0
    Thanked 207 Times in 202 Posts

  • #3
    New Coder
    Join Date
    Nov 2010
    Posts
    50
    Thanks
    16
    Thanked 0 Times in 0 Posts
    I had already done that and not come up with anything that I can use with my example.

    Can anyone else help with this specific problem?

    Basically do I have to completely re-write what I have if I want to add an option group or can I modify it?

    Cheers Daniel.

    Code:
    	var Users = new Array;
            Users[0] = new Option("Text to show in list", "Item Value");
    
            for(i=0; i<Users.length; i++) {
    		document.newforms.TelephoneSelection.options[i] = Users[i];
    	}
    Last edited by DanielHowden; 12-24-2010 at 02:47 PM.


  •  

    Posting Permissions

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