Well i'm having a problem with the compatibility of javascript and PHP multiple delete check box.. i used a javascript for the "CHECK ALL BOXES" just like yahoo mail.. so my input is something like this "" and the check all boxes function worked but it doesnt work with my PHP code where it is something like this :
$checked = $_POST["checkbox"];
for($i=0; $i < count($checked); $i++) {
....// DELETE ALL CHECKED
}
but if i change my input to something like: .. it does work on my PHP script but it wont work for my "Check all Function" javascript.. damn it.. i need help!!!
it2051229
Junior Poster in Training
82 posts since May 2007
Reputation Points: 7
Solved Threads: 1
Yes this problem of mine was since i was still learning javascript. What i did is the name is still the same where the name has the '[]' brackets so that it will work with PHP but the javascript will be different. If you mind posting your javascript so that i can see.
it2051229
Junior Poster in Training
82 posts since May 2007
Reputation Points: 7
Solved Threads: 1
On the top of the page, just include the following piece of code...
<?php
if($_POST['delete']=="Delete")
{
$delete_ids=implode(",",$_POST['checkbox']);
mysql_query("Delete from $tbl_name WHERE id in $delete_ids");
//Checkbox is the input field named checkbox.. It automatically takes goes as an array in php.
//Thats it.. you are done.....
}
sikka_varun
Junior Poster in Training
94 posts since Dec 2008
Reputation Points: 11
Solved Threads: 12