1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

FIX My PHP Dropdownlist ISSUE $10

Discussion in 'Hire a Freelancer' started by baokyrox, Dec 8, 2011.

  1. baokyrox

    baokyrox BANNED BANNED

    Joined:
    Oct 10, 2008
    Messages:
    429
    Likes Received:
    34
    service done by myself...~_~
     
    Last edited: Dec 8, 2011
  2. tanero

    tanero Newbie

    Joined:
    Jun 23, 2010
    Messages:
    23
    Likes Received:
    4
    Gender:
    Male
    I can fix it for you
     
  3. sockpuppet

    sockpuppet Junior Member

    Joined:
    Nov 7, 2011
    Messages:
    155
    Likes Received:
    145
    the document has not finished loading when you try to populate your dropdownlist, you have to put the code inside the jquery ready function
    Code:
    $(document).ready(function() {
      $.each(chapter_list, function(i,c) {
          $('#top_chapter_list, #bottom_chapter_list').append(
              $('<option></option>').val( c[0]).html(c[1])
          );
      });
    });
    
    edit:
    haha, lol too late
    edit2:
    at least my code looks nicer