Got a bit of a problem... I'm probably missing something really stupid...
I have a very simple form (code below) that has 2 different form submissions that need to coexist on the same form. My idea for getting this to work is to alter the action on click in the second submit (forms[0].action).
Sounds good in abstract, but I'm having problems. While I can alter the action easily enough, the submit button that alters the action will not submit once the script has been added to the onClick, and I cannot force the button to submit the form using script.
here's the code...
<form name="mlsSave" id=mlsSave method="post" action="find.php">
<input type="hidden" name="mlsString" value="">
<input type="hidden" name="numStored" value="0">
MLS #: <input type="text" name="mlsNum">
<input type="submit" name="store" value=" Store ">
<input type="button" name="submit" value="Submit" onclick="document.forms[0].action='sendSaved.php'; document.forms[0].submit();" >
</form>
...forms[0].submit() doesn't work. neither does document.all.mlsSave.submit(). (both generate the error "object doesn't support... this... method"
.
If I leave off the submit, then the onClick event removes the submit event, and only changes the action and nothing else.
I'd add another form, but I have a good reason for using only one. Any ideas for getting the submit to work in script, or any other ideas would be appreciated. The Jhereg
=~=~=~=~=~=~=~=~=~=~
I never lie.
I'm building a reputation for honesty so I can blow it when something big comes along... This ain't it.
I have a very simple form (code below) that has 2 different form submissions that need to coexist on the same form. My idea for getting this to work is to alter the action on click in the second submit (forms[0].action).
Sounds good in abstract, but I'm having problems. While I can alter the action easily enough, the submit button that alters the action will not submit once the script has been added to the onClick, and I cannot force the button to submit the form using script.
here's the code...
<form name="mlsSave" id=mlsSave method="post" action="find.php">
<input type="hidden" name="mlsString" value="">
<input type="hidden" name="numStored" value="0">
MLS #: <input type="text" name="mlsNum">
<input type="submit" name="store" value=" Store ">
<input type="button" name="submit" value="Submit" onclick="document.forms[0].action='sendSaved.php'; document.forms[0].submit();" >
</form>
...forms[0].submit() doesn't work. neither does document.all.mlsSave.submit(). (both generate the error "object doesn't support... this... method"
If I leave off the submit, then the onClick event removes the submit event, and only changes the action and nothing else.
I'd add another form, but I have a good reason for using only one. Any ideas for getting the submit to work in script, or any other ideas would be appreciated. The Jhereg
=~=~=~=~=~=~=~=~=~=~
I never lie.
I'm building a reputation for honesty so I can blow it when something big comes along... This ain't it.