Jump to content

Submitting A Form To More Than One Location


ShadowMage
 Share

Recommended Posts

Hi,I've done some searching but I can't seem to find what I'm looking for. Can anyone tell me if it's possible to submit an html form to more than one location.For example, in an onchange event I want to submit the form to itself, but when I click a save button I want the form to submit to a different page.Please help,Thanks!jkloth

Link to comment
Share on other sites

Just thought I'd post back to report that I've found the solution. I overlooked it on the W3Schools website.You can change the form's action attribute before you submit the form. This was the example posted in the reference:

<script type="text/javascript">function changeAction()  {  var x=document.getElementById("myForm")  alert("Original action: " + x.action)  x.action="default.asp"  alert("New action: " + x.action)  x.submit()  }</script>

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...