close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Can't Get Checkbox Group Values in Email

Thread begun 10/11/2009 12:00 pm by paputxi | Last modified 12/23/2009 10:11 am by Ray Borduin | 4100 views | 5 replies |

paputxi

Can't Get Checkbox Group Values in Email

I seem to be unable to get checkbox group values via UE. As a test, I created a very simple form using FB, which can be seen at test4.php. Using FB, I defined only two "Lines", where Line 1 is Name (a text field) and Line 2 is a Checkbox Group with three items that I labeled Item 1, Item 2, and Item3. In FB I set the "size" of the Checkbox Group to be One Column so that each item will appear on a separate line on the screen.

Then using UE to setup the email, in the Body tab I setup the four items for the email in the HTML editor part of this tab using DW, as shown in the online tutorial (i.e., binding the form elements to the correct parts of the page that I had just created). The PHP coded listed below is the resulting code generated. (I see this code when I select the Edit button in Body, after setting up the email output via the DW button.)

Name:<?php echo ((isset($_POST["fieldset_group_Name"]))?$_POST["fieldset_group_Name"]:"")?>
CBG Item1:<?php echo ((isset($_POST["fieldset_group_Checkbox_Group[]"]))?$_POST["fieldset_group_Checkbox_Group[]"]:"")?>
CBG Item2:<?php echo ((isset($_POST["fieldset_group_Checkbox_Group[]"]))?$_POST["fieldset_group_Checkbox_Group[]"]:"")?>
CBG Item3:<?php echo ((isset($_POST["fieldset_group_Checkbox_Group[]"]))?$_POST["fieldset_group_Checkbox_Group[]"]:"")?>

However, even though I check one (or more) of the checkboxes when I test it online, they do not show up in the email. I do see that the PHP code for all three Items is identical, which may be part of the problem.

Any thoughts on how to resolve this?

Sign in to reply to this post

jenkolaka19379118

This post has been deleted.

Jason ByrnesWebAssist

The values of a check box group will be sent as an Array. you can use the PHP implode() function to covert the array to a comma separated list:

php:
<?php echo((isset($_POST["fieldset_group_Checkbox_Group"]))?implode(", "$_POST["fieldset_group_Checkbox_Group"]):""?>
Sign in to reply to this post

roby258376

This worked great Ray, thanks for the code hint.

But I do have to ask why we have to make this code change after the fact instead of UE working with formbuilder automatically?? I'm sure that many folks use checkbox groups in their forms and would have to search and hopefully find this post in order to get UE to work properly. Is this a fix that's in for the next update?

Sign in to reply to this post

Ray BorduinWebAssist

I guess we could make the fix in the bindings so that when you bound to a checkbox group it automatically imploded the array.

It is not on the roadmap, but I will log it as a feature suggestion and we might be able to squeeze it into the next UE update.

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

roby258376

That would be terrific! thanks

Sign in to reply to this post

Ray BorduinWebAssist

I'll make sure it gets added... thanks for the suggestion.

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