close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Checkbox group

Thread began 8/21/2011 7:19 am by superpac250441 | Last modified 9/10/2011 11:17 pm by superpac250441 | 3644 views | 16 replies |

superpac250441

Checkbox group

Hi, I wonder if someone could assist. I have a checkbox group with 23 checkboxes which I want to insert into one data field. When I ran through SA2, it left a blank ie no checkboxes so I added them manually after the pages were made.

I understand that I the following change to each checkbox:

From:

<input type="checkbox" name="Registration_group_1_ExpertiseAreas" value="Trauma" id="Registration_group_1_ExpertiseAreas_22">

To:

<input type="checkbox" name="Registration_group_1_ExpertiseAreas[]" value="Trauma" id="Registration_group_1_ExpertiseAreas_22">

I believe I then have to make adjustments to:

"".((isset($_POST["Registration_group_1_ExpertiseAreas"]))?$_POST["Registration_group_1_ExpertiseAreas"]:"") .""

using explode? Is this the code I need to change? Any idea what the code should look like or any help whatsoever would be much appreciated?

Sign in to reply to this post

Jason ByrnesWebAssist

add the following code at line 1:

php:
<?php

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




that will automatically convert the array to a string for you, no other adjustments needed.

Sign in to reply to this post

superpac250441

Many thanks Jason - greatly appreciated!!! Just one more question as a result of looking at something Ray posted a while back. Can you do the same thing with a multi-select list?

Sign in to reply to this post

Jason ByrnesWebAssist

yes, the same technique can be used with multiple select lists.

Sign in to reply to this post

superpac250441

Thanks again Jason

Sign in to reply to this post

superpac250441

I am using the group checkboxes on the registration page and it is working perfectly thank you Jason.
However, having applied the same to the update page, it won't insert any of the checkbox values. Is there anything I am missing here?

Sign in to reply to this post

superpac250441

Any chance of a response? Thanks

Sign in to reply to this post

Jason ByrnesWebAssist

can you send a copy of the page so i can look at the code.

Sign in to reply to this post

superpac250441

Thanks Jason, see attached

Sign in to reply to this post

superpac250441

sorry, here it is

Attached Files
userupdate.zip
Sign in to reply to this post
loading

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