Forum Moderators: phranque

Message Too Old, No Replies

Help With Form Problems

must select one check box and email when checkbox is selected

         

hockim

6:20 am on Nov 21, 2007 (gmt 0)

10+ Year Member



1. I have a form with a dozen check boxes representing different companies; I would like an email to be sent to each individual company if their checkbox is selected.

2. Also I would like for at least one checkbox to be selected before the form sends.

Info. Using Dreamweaver cs3 and the form is sending to form2email.pl

Here is page in question <url removed>
I have hit a brick wall. My head hurts.

TIA

[edited by: encyclo at 10:43 am (utc) on Nov. 21, 2007]
[edit reason] no links to personal sites please [/edit]

rocknbil

8:19 pm on Nov 21, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Welcome aboard hockim, there are two things you will need to do, it is best if you use both. I'll speak generally here because the specifics are a bit long for an introduction to programming. :-)

You would want to do this client-side, that is, directly in the browser, so that it is "screened" before being submitted. This is an AID to your visitors to save them time. Most likely, this would be with Javascript.

But if Javascript is disabled, you would also need to repeat this server-side so your process is not dependent on the correct functioning of Javascript.

On your web page, you build a Javascript function that checks the "checked" state of the checkboxes, if there are none checked you return an alert and do not submit the form.

On the server side, same thing - you have a "list" of possible incoming values for the checkboxes. If there isn't one, you do not proceed, you return them to the form with the message that at least one must be checked.

For the specifics of how to program begin digging around the Javascript forum and Perl forum here.