I'm trying to use a link to submit a form. I have a form, and depending on which link is used to submit the form, I'm changing the "action" property of the form.
Here's one of my links:
<FORM name=form1 action="" method=post>
<A href="fakelink" onclick="timesheet_load();" >Fill out time sheet for this pay period</A>
....
</FORM>
..and my processing script:
function timesheet_load()
{
document.form1.action = "jobhours_query.php";
document.form1.submit();
}
It's not working as I expected. Instead of going to the jobhours_query.php (the action destination of the form), it's going to the link in the <A> tag. Is what I want to do possible?