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

Checkbox Group vs Checkbox and DataAssist

Thread began 7/01/2010 8:11 pm by andy.schofield283961 | Last modified 7/07/2010 9:57 am by Jason Byrnes | 975 views | 6 replies |

andy.schofield283961

Checkbox Group vs Checkbox and DataAssist

Hi,

I have a result page on my site which lists records found and I want to place a checkbox by the side of each with contains the record ID. I then want to submit this page to an update page which takes these ID's as a parameter and updates the database.

The problem is if I use checkboxes using dataassist search it appears to only select the the last one clicked. At first I thought it was because I was using checkboxes so i made a checkbox group thinking that would help, but no difference.

Am I missing something really obvious.

Sign in to reply to this post

Jason ByrnesWebAssist

to pass multiple values using a checkbox, the name must end in '[]' to create an array, for example:
<input type="checkbox" value="1" name="checkbox[]" />

Sign in to reply to this post

andy.schofield283961

Thanks Jason,

Managed to get it working, although it took a little editing after applying dataassist search wizard.

I created the results page manually where the recordset selects everything and then applied the search wizard. This works now but if I select nothing in my checkboxes then I get all results applied to the recordset.

I tried changing the default where clause but still no joy. Can you help?

Sign in to reply to this post

andy.schofield283961

Any ideas on how I can solve this, i keep trying but had no joy. Any help very much welcomed.

Sign in to reply to this post

Jason ByrnesWebAssist

set the trigger for the search to use the checkboxes and set the default where clause to 0 != 0.


click the lightning bolt next to trigger and select the checkbox form the form collection.

In the Default Where section, type:
0 != 0

Sign in to reply to this post

andy.schofield283961

Jason,

I have tried to follow as you directed. I assumed you meant checkbox from the form collection. I had to remove the [] from the checkbox name pulled in by the form collection for it to work. But then all was good.

And i added the default where clause...code looks like this

$WADbSearch1_DefaultWhere = "0 != 0 ";
if (!session_id()) session_start();
if ((((isset($_POST["chkBoxCherryID"]))?$_POST["chkBoxCherryID"]:"") != "")) {
$WADbSearch1 = new FilterDef;
$WADbSearch1->initializeQueryBuilder("MYSQL","1");

But it still shows all, i know this is because I dont understand the code, but if you can help me it would be appreciated.

Thanks

Andy

Sign in to reply to this post

Jason ByrnesWebAssist

please send a copy of your page.

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