I use php to display a table of data drawn from my mysql database. I have a while loop that loops through each row and spits out the user data.
I want to have a more details button that when pressed will drop down a div box displaying "more details" about the user. The problem I've run into is when I create the div to hold the more details I can't figure out how to make it unique for each user.
When I click the more details link it always opens the top most div only... because my id's aren't unique. To make the div's unique I could just echo a count to them and the href but I'm not sure how to pass that into jquery as parameter so that when I click the more details link next to a users name it will display the more details div specific to that user.
I've been toying with the below code without much luck, help appreciated. Thanks.
<script type = "text/javascript">
$(document).ready(function(){
$('a.moreDetails').click(function() {
$("#moreDetails").toggle('fast');
});
});
</script>
while()
{
user info... more details href
<div></div> to display below once more details href has been clicked.
}