i am trying to do a confirm function using javascript in php which it worked only in showing the buttons but whatever you press the form will submit heres the code and the function
<form action='Allocated.php' method='post' >
<input type='submit' name='disc' value='Discontue Asset' formnovalidate='formnovalidate' onclick='myFunction()' />
<input type='hidden' name='alloc' value='$AllocID' />
</td>
</form>
and the function
function myFunction() {
var r = confirm("Press a button!");
if (r == true) {
return true;
} else {
return false;
}
}
any help would be appreciated THanks