Skip to content

Instantly share code, notes, and snippets.

@Bolinha1
Last active December 15, 2015 17:39
Show Gist options
  • Save Bolinha1/5298450 to your computer and use it in GitHub Desktop.
Save Bolinha1/5298450 to your computer and use it in GitHub Desktop.
<?php
while($r = mysql_fetch_array($sql))
?>
<div class="menu">
<input type="hidden" name="id_pedido" id="<?php echo $r['id']; ?>" value='<?php echo $r['id']; ?>'>
<input type="radio" name='status' class='status' value="feito" checked="checked">
</div>
<?php } ?>
$('.status').click(function() {
var status = $(this).val();
var id = $('input:hidden').val();
alert(id);//Só mostra do primeiro item que o laço iterou, não importa quantos seja.
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment