POKER GAME: Process a Checkbox array?
Hello!
I'm norwegian, sorry about my english
My dillemma is that I have a 5 card poker game where I want to check the cards I want to keep. And then submit it and get some new cards.
-
$("img#card").toggle(function () {
$(this).addClass("show");
$('input[name=card[]]').attr('checked', true);
},function () {
$(this).removeClass("show");
$('input[name=card[]]').attr('checked', false);
});
This code is my jquery.
-
<input type="checkbox" name="card[]" value="a" id="card1" class="checkbox" />
<img src="Kort/10-s.png" alt="Spar 2-er" id="card" title="Spar 2-er" />
<input type="checkbox" name="kort[]" value="c" id="card2" class="checkbox" />
<img src="Kort/10-s.png" alt="Spar 2-er" id="card" title="Spar 2-er" />
This is the HTML
-
<?php
if (isset($_POST['submit'])){
echo $_POST['card'][0];
}
?>
This is the PHP
Now my problem: I can't use the card[] array in the jquery code.
How can I fix this?
Thanks for answers!
- Lars Otto