|
|||
Lawak lah tu mysticmind...
![]() ----- Anyway, what you're trying to do works better if you make it client-side processed. It is possible to do it with only PHP, but you would have to refresh the page, thus javascript would be better in this case because you won't need to refresh the page to check all the boxes. Below is a javascript snippet that I use a lot to achieve the 'select all' check boxes. Within Head: PHP Code:
<form name="userlist"> <input type="checkbox" name="selectAll" onclick="return checkAll();"> //this is the checkbox that checks all the checkboxes in form userlist <input type="checkbox" name="boxname" value="1"> //put as many of these as you need ----- For the second part of you question about the checkboxes with multiple buttons for different actions. The simplest way to do it is just to have buttons named (for example): <input type="button" value="Option1" name="button1" class="inputbox"> <input type="button" value="Option2" name="button2" class="inputbox"> etc... PHP script (assuming method = POST): [php] if (isset($_POST['']) && ($_POST[''] == "button1") { //Do option 1 } if (isset($_POST['']) && ($_POST[''] == "button2") { //Do option 2 } [php] And so on... that's just a basic outline on how to do it. You will need to adjust it to your needs. |
|
|||
Sorry... a few corrections...
But the following in your Body to use it. should be: Put the following in your Body to use it. [php] if (isset($_POST['']) && ($_POST[''] == "button1") { //Do option 1 } if (isset($_POST['']) && ($_POST[''] == "button2") { //Do option 2 } [php] should be: [php] [php] if (isset($_POST['button1']) && ($_POST['button1'] == "Option1") { //Do option 1 } if (isset($_POST['button2']) && ($_POST['button2'] == "Option2") { //Do option 2 } PHP Code:
|
|
|||
|
||||
rasanya.. kalau line kurang dan error line tuh lebih dari line coding yang ada..
selalunya ada string atau quote yang tertinggal.. menjadikan dia unclose tag.. try semak betul betul. oh ya cik rempah.. gunakan bbcode [*php] ( buang * ) tamatkan dengan [/php] lebih senang nak view kat sini rasany ![]() |
![]() |
«
Previous Thread
|
Next Thread
»
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |













Linear Mode