Jump to content


Photo

drop down list stops working after 20 records


  • Please log in to reply
3 replies to this topic

#1 jeger003

jeger003

    Advanced Member

  • Members
  • PipPipPip
  • 260 posts

Posted 24 January 2013 - 05:05 PM


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.


#2 .josh

.josh

    .josh

  • Administrators
  • 14,807 posts

Posted 26 January 2013 - 09:10 AM

Likely your problem is with your server-side code; at face value I don't see anything wrong with the js. If you posted your server-side code on pastebin, the link is invalid, so I cannot see it.

Did I help you? Feeling generous? Donate to me! || Donate to phpfreaks!
Please, take the time and do some research and find out how much it would have cost you to get your help from a decent paid-for source. A "roll-of-the-dice" freelancer will charge you $5-$15/hr. A decent entry level freelancer will charge you around $15-30/hr. A professional will charge you anywhere from $50-$100/hr. An agency will charge anywhere from $100-$250/hr. Think about all this when soliciting for help here. Think about how much money you are making from the work you are asking for help on. No, we do not expect you to pay for the help given here, but donating a few bucks is a fraction of the cost of what you would have paid, shows your appreciation, helps motivate people to keep offering help without the pricetag, and helps make this a higher quality free-help community :)

#3 jeger003

jeger003

    Advanced Member

  • Members
  • PipPipPip
  • 260 posts

Posted 28 January 2013 - 09:04 AM

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>



#4 jeger003

jeger003

    Advanced Member

  • Members
  • PipPipPip
  • 260 posts

Posted 29 January 2013 - 02:38 PM

still messing around with this and it doesnt seem to be my queries.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

Cheap Linux VPS from $5
SSD Storage, 30 day Guarantee
1 TB of BW, 100% Network Uptime

AlphaBit.com