needs_upgrade Posted May 7, 2009 Share Posted May 7, 2009 Hello guys! Please pardon me for then newbie-ish question about checkboxes. What if i have this simple code: <form action="some_file.php" method="post"> <?PHP while ($row = mysql_query($res)) { ?> <tr><td> <input type="checkbox" id="purchase_id<?php echo $n;?>" name="purchase_id<?php echo $n;?>" value="<?PHP echo $row[0] ?>" onclick="some_js_function();"> </td></tr> <?PHP } ?> <input type="submit" value="submit"> </form> How can i get the values of the selected purchase_id's? Thanks guys. Link to comment https://forums.phpfreaks.com/topic/157229-question-regarding-checkboxes/ Share on other sites More sharing options...
Ken2k7 Posted May 7, 2009 Share Posted May 7, 2009 Please read #4 of Forum DOs - http://www.phpfreaks.com/page/rules-and-terms-of-service#toc_forum_dos First change the name to "purchase_id[]" Then grab with $_POST['purchase_id']. <-- that will return an *array* Link to comment https://forums.phpfreaks.com/topic/157229-question-regarding-checkboxes/#findComment-828462 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.