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

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

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

 



RobL
Deleted

Aug 2, 2000, 11:12 PM

Post #1 of 3 (3117 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.

e.g.,

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.

e.g.,

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

Thanks

Rob


rGeoffrey
User

Aug 3, 2000, 12:46 PM

Post #2 of 3 (3117 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="display.pl" name="memberform">

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

<input type="submit" name="editmembers" value="Submit Event"
onclick="forms.memberform.action = 'event.pl';">
</pre><HR></BLOCKQUOTE>

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.


D_W
Deleted

Dec 28, 2000, 2:37 PM

Post #3 of 3 (3103 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