Forum Moderators: open

Message Too Old, No Replies

Specifying recipients based on form selections

Is it possible to direct a form to send to specific email address?

         

KellyRyan

2:33 pm on Sep 16, 2008 (gmt 0)

10+ Year Member



Hi,

I am a web author in a staff development department at a univeristy and I am currently working on workshop booking forms.

The form I will be working on next will contain information on several different workshops being hosted by different departments which means that the booking contact is going to be different for each workshop.

I was wondering if it is possible to direct a form, once submitted, to a specific person(s) depending on which groups of radiobuttons have been selected.

I should point out that to guard our branding we have no control over external parts of forms (eg. cgi-bin/sendmail.pl).

I understand the risk of spambots and all that jazz but the restrictions we face leave us with only a basic ability meaning that mail adresses will need to be referenced within the HTML.

Hope this makes sense!

Kelly

Marshall

3:30 pm on Sep 16, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Hi Kelly and welcome to WebmasterWorld.

Generally, the form handler script, whether .asp or .php, can include an 'if' statement that 'if form field X is selected, email to ...', 'if form field y is selected, email to...'.

Not knowing how your form handler reads, I can only offer this limited answer. The exact semantics would depend on the form.

Marshall

rocknbil

3:46 pm on Sep 17, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I kind of avoided this one because putting email in the source code is always an extremely bad idea (spam.) But if your form does this,

<input type="hidden" name="recipient" value="some_email@example.com">

It's an easy thing to change it to this:

<select name="recipient" id="recipient">
<option value="johndoe@example.com">John Doe</option>
<option value="marydoe@example.com">Mary Doe</option>
</select>

Even better, if you do have access to a server side processor, you do this:

<select name="recipient" id="recipient">
<option value="1">John Doe</option>
<option value="2">Mary Doe</option>
</select>

then in your form processor, you have a list that associates 1 with johndoe@ and 2 with marydoe@.