Specials | Announcements | Contact | Site Map
Willmaster.com
Hijack-proof forms. Surveys. List building.

Solid, safe website tools.

Whatever your need, Will Bontrager builds powerful software solutions.

Affiliate Cookie Setter
Search WillMaster.com:

WillMaster > Support > CGI Q&A

If you don't find the answer to your question in these archives, ask your CGI question at the Current Master Series CGI Forum.

1 form, 2 button, 2 action

Author Message
17Jul01

Wilhelm
Subject: 1 form, 2 button, 2 action

Is it possible to send 1 form to 2 different cgi sripts with 2 buttons?
My shop software is generating the Master Recommend Pro form dynamicaly, including some text, links, etc. for the product to recommend.
Also there is a loop function to generate X input fields (selected input "howmany") for a multifriend recommendation.
Problem:
How might I send the form with one submit button to the shop software when the visitor wants more input fields (without loosing his recent entries), and with another button to Recommender Pro to send out the recommendation mails?
Thanks, Wilhelm

17Jul01

Will
In response to: 1 form, 2 button, 2 action

I don't know exactly what you require, Wilhelm, but here are several ideas you may wish to consider.

If you can keep the forms separated, even if on the same page, it would reduce the complexity. But I'm assuming that isn't possible.

A previous post by Zeb titled "Form with two 'actions'" addresses the problem of multiple actions per form. The article "Putting Form Confirmation Pages Into Popups" linked from http://willmaster.com/library/ shows how to launch a CGI program from a window different that the form. It would have to determine which submit button was clicked to know whether or not it should proceed.

Another method could be to have one script call the other when a certain submit button was clicked. The Perl function "system" would probably be used for this, although "exec" might be more appropriate in certain situations.

I'm hoping that helps. Hooking up more than one script to the same form introduces a lot of complexity.