How can I record the order of clicked checkboxes in PHP/MySQL?
Posted 10 July 2006 - 03:12 PM
Does any of this make sense?
Thanks in advance to anyone who can offer some help and/or suggestions!
Posted 10 July 2006 - 03:24 PM
Posted 10 July 2006 - 03:29 PM
You could try an onClick event to trap the checkbox that is clicked.
EXAMPLE.PHP <form name="form1" action="action.php" method="post"> <input type="checkbox" name="C1" value="Author1" onClick="location.href='checkclick.php?box=C1"> <input type="checkbox" name="C2" value="Author2" onClick="location.href='checkclick.php?box=C2'"> </form>
CHECKCLICK.PHP $clicked_box = $_GET['box']; $box_order_array[number] = $clicked_box header ("Location: example.php?box=$clicked_box");
Obviously you will need code in the EXAMPLE.PHP to trap the return and put a check in the corresponding box. And you will probably need a global variable (to count the number of boxes clicked for the array in CHECKCLICK.PHP), unless you just use the same page (ie action="<? $_SERVER['PHP_SELF']; ?>")
Hope this kinda sheds some light
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users