I have a button which call a JavaScript function:
Code: Select all
<input type="submit" name="delete" value="Delete" onClick="return confirmSubmit()"Code: Select all
function confirmSubmit()
{
var agree=confirm("Are you sure you wish to continue?");
if (agree)
return true ;
else
return false ;
}On same page a I have more checkbox :
Code: Select all
<input type="checkbox" name=\"list[]\" value="{$row['id']}" /></td>";Code: Select all
if (isset($_POST['list'])I want to call the JavaScript function "Are you sure you wish to continue?" if one checkbox or more selected. If no checkbox selected I want to show : "Nothing selected" and don't call JavaScript function.
My page now call the JavaScript function with or without checkbox selected.
I appreciate any help!
I don't have much knowledge with JavaScript.
Thank you !