Page 1 of 1

pulling values of checkboxes into confirmation popup

Posted: Tue Mar 09, 2010 11:51 pm
by kevinwinters
I have several checkboxes in a form like this:

Code: Select all

 
<input type=checkbox  style="border: 0;" value="'.$row->id.'" name="batchdelete[]" >
 
what I want to do is onsubmit popup the message about which boxes the person is going to delete like this:

Code: Select all

 
<SCRIPT LANGUAGE="JavaScript">
    function confirmation(f){
  if (confirm('Are you sure you want to permanently delete these '+furn_tab.batchdelete[].value+' records ??? Click "OK" to submit delete or "CANCEL" to reject the change')) {
    f.submit();}
    else {
    return false }
    }
</SCRIPT>
 
I call the script with this:

Code: Select all

 
$sHtml  = '<form name="furn_tab" method ="post" action ="xhr-delete-batch.php" onsubmit ="return confirmation(this)">';
 

However I get an error, it doesn't seem to like my batchdelete[] checkboxes


is there a way I can display the value of each checked box in the confirmation popup?