close ad
Install the LAtest Updates to Work with CC 2017 and CC 2018
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Form to post several questions into one feild

Thread began 8/22/2013 11:28 pm by eric284736 | Last modified 8/23/2013 7:51 pm by eric284736 | 454 views | 5 replies |

eric284736

Form to post several questions into one feild

Hi, Jason,

I have a form with about 20 questions and the last has several choice selected by radio but, but some questions might no be answered. Is there a way to capture the static info and then place all of the multiple questions into one field in the database?

thx
Eric

Sign in to reply to this post

Jason ByrnesWebAssist

Instead of using Radio buttons, use checkboxes.

name them all the same so that they will be a checkbox group.

the checkbox group will send the selections as an array. You can convert the array to a comma separated list using the following code on your page:

php:
<?php

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

eric284736

Okay, I have the checkbox group setup. I have not added the array code above because I am not sure where to place that in the page. I have a field in the table named PositionSignUp to place the checked positions.

thx
Eric

Attached Files
volunteer-signupTEST.zip
Sign in to reply to this post

Jason ByrnesWebAssist

1) you have the names of the checkboxs set to be dynamic:
name="<?php echo $row_rsTours['trID']; ?>-VolunteerPosition"

this wont work, the checkbox names need to be static.

2) in the insert record behavior, bind the column you wish to store the checked values to the checkboxes.

3) after making the binding change, add [] to the end of the checkbox names

4) add the code i provided at line 1.

Sign in to reply to this post

eric284736

Ahhh! Okay, I follow that.


thx
Eric

Sign in to reply to this post

eric284736

That works perfectly! Thanks Jason!!

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