So I have two buttons, and for one, it is simply "submit", no on submit needs to be used for it. The other one is "delete" and I wanna have a confirm box open when you click delete saying something like "are you sure you want to delete?" and clicking yes would delete it and no would not. Here is the javascript I have so far for it.
Code:
<script type="text/javascript">
function OnButton1()
{
document.simpForm.action = "<?php php stuff here ?>";
document.simpForm.target = "_self";
document.simpForm.submit(); // Submit update
return true;
}
function OnButton2()
{
document.simpForm.action = "delete.php?id=<?php php stuff here ?>";
document.simpForm.target = "_self";
document.simpForm.submit(); // Delete the company
return true;
}
</script>
Any help would be GREAT! Javascript is not my strong point