SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Enthusiast sffc's Avatar
    Join Date
    Jul 2006
    Posts
    90
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Arrow every option in a combo box

    How do I make an array with every option of a combo box?
    "I haven't failed, I just found
    100,000 ways that don't work"
    Thomas Edison

  2. #2
    SitePoint Enthusiast sffc's Avatar
    Join Date
    Jul 2006
    Posts
    90
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Nevermind! I found a way!

    Code:
    var a = document.myform.myselect.length;
    var i = 0;
    var b = new Array();
    while(i<a){
    	b.push(document.myform.myselect.options[i].value)
    	i++
    }
    //and the values are in b
    "I haven't failed, I just found
    100,000 ways that don't work"
    Thomas Edison


Bookmarks

Posting Permissions

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