Need help with jquery to change my forms action depending on with SUBMIT Button press. I found some javascript code but its not working.
<form name="myform" onsubmit="return onsubmitform();">
Here is the function
<script type="text/javascript">
function submitform()
{
if(document.pressed == 'Save')
{
document.myform.action ="jbupdate.php";
} else
if(document.pressed == 'Print')
{
document.myform.action ="ppage.php";
}
return true;
}
</script>
and these are my submit buttons
<input type="submit" name="operation" onclick="document.pressed=this.value" value="Save" />
<input type="submit" name="operation" onclick="document.pressed=this.value" value="Print" />
I will like to POST this information to these action pages depending on the button pressed.