CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
Search Posts SEARCH
Who's Online WHO'S
Log in LOG

Home: Need a Custom or Prewritten Perl Program?: Throw Down The Gauntlet:
submit form to multiple cgi programs



Aug 2, 2000, 11:12 PM

Post #1 of 3 (6230 views)
submit form to multiple cgi programs Can't Post

Do you know of a script that would allow a form to be submitted to different cgi script
depending on the data entered into the form and in some cases the same data might be needed
to be submitted to two cgi scripts and some fields combined.


I have one form into which people can submit either news or events.
In some cases the form should submit to the news cgi program (if they have selected news) in
other the events cgi program (if they have selected events). It might also be necessary to
combine fields.


eventtype field and event venue field are combined for news submission to the description field,

Description = " the following event (eventtype field) will be held at (event venue field)

Can you help




Aug 3, 2000, 12:46 PM

Post #2 of 3 (6230 views)
Re: submit form to multiple cgi programs [In reply to] Can't Post

Here is one possiblity...

<BLOCKQUOTE><font size="1" face="Arial,Helvetica,sans serif">code:</font><HR>

<form method="POST" action="" name="memberform">

<input type="submit" name="editmembers" value="Submit News"
onclick="forms.memberform.action = '';">

<input type="submit" name="editmembers" value="Submit Event"
onclick="forms.memberform.action = '';">

The default action of the form is set to something simple, like display this page again. But usually that action is never taken. Each button is given an onclick effect to change the action of the form.

Each destination knows all the form data because they receive the same form. So you can combine the parts any way you need to on the other end.

If you choose to use this method you should realize that it does not work if your user chooses not to allow Javascript (fortunately that is not a problem in my environment). You can work around the problem by making a smart default script. It will know that it is only called when Javascript is off and repackage the form variables so it can redirect itself to the correct script.


Dec 28, 2000, 2:37 PM

Post #3 of 3 (6216 views)
Re: submit form to multiple cgi programs [In reply to] Can't Post

I am looking for something similar to this:
I have 2 forms on one page and I need form 1 to go to script1.cgi and form 2 to go to script2.cgi but using only one submit button to submit both forms. Is this possible? I tried working with the script above but it doesn't happen for me. ANy help would be appreciated. Thx.


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives