hey guys, im having some trouble... i'm able to capture the first button on the page, but there are a total of 10 buttons. When I click on any of those 10 buttons, only the first button's value is called and the other ones don't update. is there a way to capture all of the buttons so they each have their own independent value and update their values so jQuery's ajax function gets the new one? the buttons are being created out of a multidimensional array loop.
<?php
$characters = $char->getCharactersListFromAccountId($_SESSION['acctid']);
foreach ($characters as $key) {
if(is_array($key)){
echo "<input class=\"button\" type=\"button\" href=\"javascript:void(0)\" value=\"Show\" style=\"vertical-align: top\" />";
echo $char->getFaction($key['guid']), " ";
echo $char->getClass($key['guid']), " ";
echo "<span class='style'>", $char->getLevel($key['guid']), "</span> ";
echo "<span class='style'>", $key['name'], "</span>";
echo "<input class=\"GUID\" type=\"hidden\" name=\"GUID\" value=\"";
echo $key['name'];
echo "\" />";
echo "<br>";
} else {
echo "<br>";
echo "<b><h1>My Characters: $key</h1></b><br />\n";
}
}
?>
<div id="view" style="display: none;"></div>
<script>
$(".button").livequery('click', function(event) {
var GUID = $('.GUID').val();
$("#view").html('Retrieving...');
$("#view").show("slow");
$.ajax({
type: "POST",
data: "ID=" + GUID,
url: "character.php",
success: function(msg){
$("#view").html(msg);
}
});
});
</script>