javascript - Submiting one form to two different URLs -
hello, folks!!
i not experience. appreciate follows:
goal: run 2 actions associated 1 submit, have add urls , pull out necessary info need form.
constraints: no access database, no ajax , no php.
problem: nothing happens when use <input type="button" value="submit" onclick="onbtn1(); onbtn2();">
i tried these no luck:
html code:
<script type="text/javascript"> function posttourl () { document.form1.action = "https://db2.com/cgi-bin/b.cgi?" document.form1.submit(); } </script> <form id=" form1" method="post" action="https://db1.com/cgi-bin/a.cgi?" onsubmit="posttourl();"> <input type="text" id="field1" name="field1"> <input type="text" id="field2" name="field2"> <input type="button" value="submit" name="sdb"> </form>
can please me? thank you!
the best solution use ajax, send form twice on submit event.
maybe can try add hidden form mirrored values different action
url. way, when submit form submit hidden 1 too.
Comments
Post a Comment