Two action values

windows

Guest
I'm wondering...is it possible to have two web addresses in the action parameter of a <form>? I've tried a few ways, but no luck.<!--content-->No, you'll just have to have action 1 pass the results onto action 2 on the server-side.<!--content-->Yes,<br />
You can add another url for action with javascript<br />
look at this simple script<br />
<br />
first button opens test.html<br />
next button opens next.html<br />
Bhanu<br />
<br />
-----------------------------------------------------<br />
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><br />
<br />
<html><br />
<head><br />
<title>Untitled</title><br />
</head><br />
<script language="JavaScript"><br />
function ChangeAction(url){<br />
document.forms['main'].action = url; <br />
document.forms['main'].submit();<br />
}<br />
</script><br />
<body><br />
<form name="main" action=""><br />
<input type="Submit" value="Test.html" onclick="ChangeAction('Test.html')"><br />
<br />
<input type="Submit" value="Next.html" onclick="ChangeAction('Next.html')"><br />
</form><br />
<br />
<br />
</body><br />
</html><br />
------------------------------------------------------<!--content-->And how exactly can you submit twice? After you submit it once, you're not on that page any more.<!--content-->Ya,<br />
you can change to any url but you can submit only one page.<br />
only solution is open in another window.<br />
Bhanu<!--content-->But that is JavaScript dependant, the simplest and most accessible solution would be to do it on the server-side.<!--content-->I found that I could add an onLoad to the CGI success page, and submit the second form that was included on it. The problem is client-side as you said, lava...if you're trying to carry a second form of content that is user input, you have a focus problem. This is what I'm wondering, how to run one form.submit() in one instance, and close it behind the scenes while the second is going and becomes the window focus.<!--content-->I don't get it,why rely on a JavaScript solution when a server-side solution could be implemented just as easily?<br />
<br />
Have the form submit to script 1, let script 1 process it, then pass the data to script 2 on the server-side (either via headers or the querystring).<br />
<br />
Better still, why don't you just combine the scripts?<!--content-->That's my question, Bhanu...how do you run each submit in a seperate window?<!--content-->Only thing I know how to do is submit a form, how do you pass a form data by header or querystring?<!--content-->You must know how to process and handle data on the server-side as well, why else would you submit a form?<br />
<br />
In the form tag you specify the method by which the form is submitted. method="get" or method="post". "get" adds the submitted data onto the end of the URL, for example, the URL of the page I'm looking at now is this:<br />
webdeveloper.com/forum/newreply.php?s=&action=newreply&threadid=37574<br />
<br />
There are 3 name/value pairs in there, s="", action="newreply", threadid="37574". That's what the URL might look like if you used method="get".<br />
<br />
If you use method="post" then the data is submitted using page headers which you can't see in the URL bar.<br />
I don't know how to create page headers in CGI so you'll have to ask in "Other" scripting forum.<br />
<br />
If you were using method="get" to submit the form then that's easy, you just use 1 redirect header (you could probably find out what the redirect header is from a quick google search) and attach all of the name/value pairs onto the end of the URL:<br />
blah.com/blah.html?name1=value1&name2=value2...<!--content-->What is a redirect heading?<!--content-->Header not heading. It's just something that the server can send to the browser to get the browser to go to a different location. All headers must be sent before any content is sent back though.<br />
<br />
Here is an ASP redirect header that I use to redirect people I have IP blocked on probes.tk:response.redirect "http://www.w3.org"Here is a PHP redirect header:Header( "Location: <!-- m --><a class="postlink" href="http://www.w3.org">http://www.w3.org</a><!-- m -->" );Simple as that.<!--content-->
 
Back
Top