Jamie18
Aug 15th 2007, 1:46 pm
i want to use javascript to figure out which submit button has been pressed, cancel or update, before i run the form validation onsubmit..
i.e.
html
<form .. onsubmit="checkcomplete()">
<input type="submit" value="cancel">
<input type="submit" value="update">
.....
</form>
javascript pseudo
function checkcomplete
{
if cancel button clicked
return false
else
return results of form validation tests
}
any way to determine which button has been pressed?
i.e.
html
<form .. onsubmit="checkcomplete()">
<input type="submit" value="cancel">
<input type="submit" value="update">
.....
</form>
javascript pseudo
function checkcomplete
{
if cancel button clicked
return false
else
return results of form validation tests
}
any way to determine which button has been pressed?