ShadowMage Posted September 14, 2009 Share Posted September 14, 2009 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 More sharing options...
justsomeguy Posted September 14, 2009 Share Posted September 14, 2009 No, a form can only submit to a single place. You can use an ajax request if you want to send data to more than one location. Link to comment Share on other sites More sharing options...
ShadowMage Posted September 15, 2009 Author Share Posted September 15, 2009 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 More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.