action url change on submit form

M

MZ

Hello!

Is it possible to change URL form action on submit form...

I have tried such code:


<script language="JavaScript" type="text/javascript">
function changeURL()
{
document.location='http://www.XXX.com/'+'?dzial='+docu...al='+document.getElementById('pdzial').value;}</script><form name="formularz" id="formularz" method="post"action="http://www.XXX.com/" onKeyUp="sprawdzajForm_spec();"> Dept:<input name="dzial" id="dzial" size="10" maxlength="9" type="text"value="11"> Subdept:<input name="pdzial" id="pdzial" size="10" maxlength="9"type="text" value="b"> <input id='sendOgl' style="display:none;" type="button"onclick="changeURL();wyslij();" value="Wyslij ogloszenie" class="wyslijOgl"></form>but it doesn`t work well and it didn`t change my URL form action .Thank you in advance for any commentsKindest regardsM.
 
E

Erwin Moller

MZ said:
Hello!

Is it possible to change URL form action on submit form...

I have tried such code:


<script language="JavaScript" type="text/javascript">
function changeURL()
{
document.location='http://www.XXX.com/'+'?dzial='+document.getElementById('dzial').value+'&pdzial='+document.getElementById('pdzial').value;} said:
name="formularz" id="formularz" method="post"action="http://www.XXX.com/"
onKeyUp="sprawdzajForm_spec();"> Dept:<input name="dzial" id="dzial"
size="10" maxlength="9" type="text"value="11"> Subdept:<input
name="pdzial" id="pdzial" size="10" maxlength="9"type="text" value="b">
<input id='sendOgl' style="display:none;"
type="button"onclick="changeURL();wyslij();" value="Wyslij ogloszenie"
class="wyslijOgl"></form>but it doesn`t work well and it didn`t change my
URL form action .Thank you in advance for any commentsKindest regardsM.

Hi,

Your posting came through scrambled in my newsreader.
But to change the action is a form is easy:

<form action="script1.php" name="myForm">
<input type="text" name="firstname">
<input type="submit" value="submit to original script">
<input type="button" value="submit to script2.php"
onClick='document.forms.myForm.action="script2.php";
document.forms.myForm.submit();'>
</form>

Regards,
Erwin Moller
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top