W3C home > Mailing lists > Public > www-talk@w3.org > January to February 2004

Re: PERL CGI: 2 POST methods using same parameters

From: Calvin, Lee Kai Chuen <Calvin.Lee@corp.sunday.com>
Date: Mon, 26 Jan 2004 09:41:26 +0800
Message-ID: <942EFBC0CC0ED61186890008C7733BED0A4FA854@exchan01>
To: "'Ariadna Font Llitjos'" <aria@cs.cmu.edu>, www-talk@w3.org
Hi,

you may need to use javascript here...

e.g. html segment:

<form id="yourform" name="yourform" method="post">
	<!-- some form elements go here -->
	<!-- some form elements go here -->
	<!-- some form elements go here -->
	<!-- some form elements go here -->
	<input
		value="post to action_1.cgi"
		type="submit"
		onclick="action(this.form,'action_1.cgi')"
		onkeypress="action(this.form,'action_1.cgi')"
	/>
	<input
		value="post to action_2.cgi"
		type="submit"
		onclick="action(this.form,'action_2.cgi')"
		onkeypress="action(this.form,'action_2.cgi')"
	/>
</form>

you may need some javascript like this (put them in <head> part):

<script type="text/javascript">
<!--

function action(frm,url) {
	frm.action = url;		// this is the meat
}

//-->
</script>

onclick event & onkeypress event drive to set up the targeted cgi url.

Regards,
Calvin



> -----Original Message-----
> From:	www-talk-request@w3.org [SMTP:www-talk-request@w3.org] On Behalf Of
> Ariadna Font Llitjos
> Sent:	Thursday, January 22, 2004 8:07 AM
> To:	www-talk@w3.org
> Cc:	aria+@cs.cmu.edu
> Subject:	PERL CGI: 2 POST methods using same parameters
> 
> 
> Hi,
> 
> I'm trying to create an html page (with a cgi script) which after allowing
> 
> the user to pick among a few choices (by checking on the appropriate 
> check-box), it asks the user to pick between two actions, namely two 
> different POST methods which take them to different cgi scripts, but which
> 
> need to have access to the same set of values.
> 
> The problem I am having right now is that if the user picks the second 
> action by clicking on the second submit button, the values only get stored
> 
> in the first form (ie. when clicking on the first button), and I don't
> seem 
> to have access to them from the second form.
> 
> Is there a way to share the values between two html forms containing POST 
> methods pointing to different cgi scripts?
> If not, what would be the best way to share user choices between to
> scripts 
> that can be called from the same html page?
> 
> thanks,
> 
> Ariadna Font Llitjos
> aria@cs.cmu.edu
Received on Sunday, 25 January 2004 20:43:22 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 5 February 2014 07:14:03 UTC