hi,
i am not a js guru so pls permit my naiveness. I need the 'delete' button on the highlighted graphic to delete all checked pics for delete. My view has the checkboxes as an array so i need to pass this array to a javascript function.
Code:
<li class="remove_chk2"><input name="delete[]" type="checkbox" value="<?=$pics['PicID'];?>" /></li>
//$pics['PicID'] is from the db - the pic
<div class="page_button1">
<p>
<a href="javascript:confirmationMultiples('delete[]', <?=$this->galleryID;?>, <?php echo "'" . $type . "'"; ?>)">Delete</a>
</p>
</div>
So once clicked ('delete' button) one would get a pop up asking if all pictures should be deleted. But in actual fact the pictures are just flagged inactive in the db table for the pics.
Code:
function confirmationMultiples(ID, Request, Type) {
var answer = confirm("Are you sure you want to delete the selected pictures?")
if (answer){
alert("Entry Deleted")
window.location = "http://mainevent.com/admin/galleries/delete-pics/pid/" + ID + "/type/" + Type + "/id/" + Request;
}
else{
alert("No action taken")
}
}
// where request is the id for the gallery
// type is the type of gallery - event/venue gallery
// ID - should be the pics checked from the view on POST
WHat exactly am i doing wrong??? currently my URL reads as
Code:
http://mainevent.com/admin/galleries/delete-pics/pid/delete[]/type/event/id/313
I think the main hassle is from posting the form getting all the checkboxes in array delete[] to the js and then to the php controller that then initiates the delete by reading the parameter from the URL.
Pls help!!