Jump to content

drop down list stops working after 20 records


jeger003

Recommended Posts

I have this:

http://jsfiddle.net/Mxkfr/2/

after adding my mysql query to the drop down it stops working after the 20th record in the first drop down. meaning it wont show up the record of the second drop down It's exactly the 20th. the drop down has 150 records.

http://pastebin.com/G8UJei6A

I put my code on jsfiddle and pastebin because I don't like it coming up on google.

here it is again.

 


<script>
$(document).ready(function() {
   $("#domains").children('option:gt(0)').hide();
   $("#bts").change(function() {
       $("#domains").children('option').hide();
       $("#domains").children("." + $(this).val() + "").show()
   })
})
</script>
<form action="#" method="get">
<select name="bts" id="bts">
   <option></option>

   <?php
   //mysql_close();
   $query = mysql_query("SELECT DISTINCT bt_name, sd,id FROM db.s WHERE bt_name != 'optimus' ORDER BY id");

   while($botname = mysql_fetch_array($query))
   {
       echo '<option value="'.$botname['id'].'">'.$botname['bt_name'].'</option>';
   }

   ?>

</select>

<select name="domains" id="domains">


   <option></option>

   <?php
   //mysql_close();
   $query = mysql_query("SELECT DISTINCT bt_name, sd,id FROM db.s WHERE bt_name != 'optimus' ORDER BY id");

   while($botname = mysql_fetch_array($query))
   {
       echo '<option value="'.$botname['sd'].'" class="'.$botname['id'].'">'.$botname['sd'].'</option>';
   }

   ?>







</select> 
<input type="submit" name="go"/>
</form>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.