Script for auto-responder
Posted on 2003-11-29
My HTML "Subscription" form has a number of text fields, 2 list boxes (State & Country) and one radio button group. All fields, with the exception of 2 are 'required'.
I have written my CGI using Perl. The first part of the form rewrites to form if there are any 'required' fields that were not filled in. In rewriting the form, I have written script to retain any previously entered data in the forms fields. I have been successful at doing this for all fields but one; the radio button group.
The HTML is calling for no 'default' radio button. The subscriber is to select one and I want the script to rewrite the group, retaining the selected (checked) radio button.
The rewritten page is designed to allow the subscriber to complete the required fields and the to resubmit the form.
A. A response screen is now written and displayed in the browser.
B. An auto-responder forwards a thank-you to the subscriber and
C. The form data is forwarded to my email address.
Problem: the autoresponderAND response to my email address is forwarded when submitted to the HTML form. Therefore, if all fields are not conpleted, the auto-responder is still activated as is the response to my email address, providing me with only partial info.
There is probably an 'else' statement missing somewhere, but I can't seem to get it right.
HELP, before I finish pulling out my 56 year old hair.
PS: If need be, I can forward the applicable script. There is really way too much to post here.