close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Different Receipients depending on selection

Thread began 6/02/2009 4:32 pm by Vikingbear | Last modified 6/10/2009 6:17 am by Ray Borduin | 3460 views | 8 replies |

Vikingbear

Different Receipients depending on selection

Hi,

Does anyone know how to send a form to different email addresses depending on a selection in the FORM?
Radio button preferred..

I have both ValidationToolkit and Contact Form Solution Pack

Any idea greatly appreciated!

Sign in to reply to this post

Ray BorduinWebAssist

Just add the radio buttons to the page and set their values to the email address you want to send it to. Then update the To field in the contact form solution pack global if you are using the contact form solution, or update it directly in the Email Server behavior To field if you are using Universal Email alone or would prefer to not use a global.

You can use the bindings to see how to reference the radio button value from the form in the code.

Sign in to reply to this post
Did this help? Tips are appreciated...

Vikingbear

Good News... a solution..

let me see if I get this right..

The code in the form:
<input type="radio" name="England" value="email@emailaddress.uk" id="England" />
<input type="radio" name="Australia" value="email@emailaddress.au" id="Australia" />

however, the Code in WAGLOBAL? what do I put in there?
$WAGLOBAL_Email_To = "??" ;

Consider me a non-programmer :)

Sign in to reply to this post

Ray BorduinWebAssist

Nope...

The code in the form:
<input type="radio" name="CountryEmail" value="email@emailaddress.uk" id="England" checked />
<input type="radio" name="CountryEmail" value="email@emailaddress.au" id="Australia" />

the Code in WAGLOBAL:
$WAGLOBAL_Email_To = $_POST['CountryEmail'] ;

Sign in to reply to this post
Did this help? Tips are appreciated...

Vikingbear

Cheers Mate

Thanks Ray..

You are a life saver... much appreciated!

Sign in to reply to this post

Vikingbear

A small 'glitz' maybe...

Hi, Ray..

The code works great, one small thing thou!

The resulting email shows the following:
CountryEmail: info@emailaddress.uk

But since some of the countries go to the same email address, I am not capturing the selection they have made.. in this case what country their passport is from..
Without adding a field to the form, is there anyway I can pick up the 'ID' from the form field?

<input type="radio" name="CountryEmail" value="info@vikingbear.com" id="Argentina" />
Argentina<br>
<input type="radio" name="CountryEmail" value="ken@kangarootrails.com.au" id="Australia" />Australia<br />
<input type="radio" name="CountryEmail" value="info@vikingbear.com" id="Belgium" />
Belgium<br>

Any Idea is greatly appreciated!

Sign in to reply to this post

Ray BorduinWebAssist

Not really... only one value is submitted, so you can't both use the email and another more unique attribute... it just doesn't work that way.

You might try adding a couple of spaces before or after the email address so that it is unique. Having spaces may not throw off the email and will allow the values to be differentiated.

Sign in to reply to this post
Did this help? Tips are appreciated...

Vikingbear

Thanks Again

Hi, Ray

Thanks again for your time looking into this, I think what I might do then is to set up an email address for each, ie. norway@blah.com and FORWARD the email in my Cpanel to the 'normal' email address, this way it will be clear what country was ticked.. long way around but any solution is a good solution :)

Another tricky one for you!
Is there a way to determine the order each field is listed in the resulting email? and even exclude fields like 'submit' there is no reason for that one to show..

Sign in to reply to this post

Ray BorduinWebAssist

You can edit the email body to create a specific order.

The easy way to keep form elements from showing is to name them... anything that begins with the name: "Security_" will not be included.

So you can name your form button: name="Security_submit" and it won't be included in the email.

Sign in to reply to this post
Did this help? Tips are appreciated...

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...