close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

one form for selectable email data loops

Thread began 4/03/2013 1:36 pm by wanakavideo420554 | Last modified 4/05/2013 6:55 am by Jason Byrnes | 1430 views | 5 replies |

wanakavideo420554

one form for selectable email data loops

Hi I'm creating a email form for a stage production where I want to be able to send emails via a drop down menu list (for the recipient groups) I created already recordsets for cast, band, crew etc. how can I make universal email make recognize the email addresses of the selected menu option and the recordset assigned with it.

Thanks

Sign in to reply to this post

Jason ByrnesWebAssist

i dont follow, can you provide more derails please.

Sign in to reply to this post

wanakavideo420554

In the email form the recipient (email to) is a list of different groups, e.g. if I want to send an email to all cast members I select "cast" and the recordset lists the email addresses of the group "cast" if I want to send emails to the band I select "Band" an the recordset lists the email addresses of the group "band" ... so UE needs to recognize which recordset to use. (see screen shot attached)

Sign in to reply to this post

Jason ByrnesWebAssist

dont use multiple recordsets. use only one recordset.

the value of the select list should pass the group ID, you can then use the select list to filter the recordset on the selected group ID to return the emails for the selected group.

Sign in to reply to this post

wanakavideo420554

Hi Jason, Thanks this makes sense for a single group, if I want two groups selected and would use the "contains" statement how would the value in the form look? What is the separator for multiple values?

Sign in to reply to this post

Jason ByrnesWebAssist

to select multiple groups, you would need to set the Select list as a multiple select list, and edit the name to include "[]" at the end:

php:
<select name="selectName[]" multiple id="select">



The way a multiple select list works in PHP is that the selections are added to an array. The array needs to be converted to a comma separated list. Add the following code at line 1 to convert the array:

php:
<?php

if($_SERVER["REQUEST_METHOD"] == "POST")     {
    foreach(
$_POST as $key => $val) {
        if(
is_array($_POST[$key])) $_POST[$key] = implode(", "$_POST[$key]);
    }
}
?>




when creating the recordset, you will need to use advanced mode. in the recordset, you can use the IN keyword in the WHERE Clause, for example a simple recordset to select where multiple IDS exist, would look like:

SELECT * FROM tableName WHERE groupID IN (1, 4, 5)




to use the select list value instead of hard coding the group IDs:

php:
SELECT * FROM tableName WHERE groupID IN (".((isset($_POST['selectName']) && $_POST['selectName'] !="")?$_POST['selectName']:"199").")
Sign in to reply to this post

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...