close ad
Help us test the new Databridge BETA with MySQLi support
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Multiple Select List not pulling results

Thread began 1/27/2013 3:21 pm by erin4435 | Last modified 2/22/2013 5:35 pm by Jason Byrnes | 2565 views | 11 replies |

erin4435

Multiple Select List not pulling results

Hello,

After creating my DataAssist Pages, I modified my search page to include mutiple select dropdown lists rather than open-ended searches. I want a user to be able to select multiple parameters (from different categories, and possibly more than one option from a category), which it currently is doing correctly. However, then I want the results to only show choices that include all of the selected parameters. Currently, it is showing all options that include at least one of the selections.

Is there a way to update my results page to make this happen? Or am I possibly not approaching it correctly when modifying the search page? Thanks for the help!

Sign in to reply to this post

Jason ByrnesWebAssist

when using a multiple select list, the selections are sent as an array.

the array needs to be converted to a comma separated list.

In the data assist search behavior, you also need to set the criteria that is using the select list to a Keyword criteria type, and set the OR separator to use a comma followed by a space:
", "

send a copy of the search page please and I can give you code you will need to convert the selections from an array to a comma separated list.

Sign in to reply to this post

erin4435

Thank you! I have uploaded both my search and results page below. Thanks again for your help.

Attached Files
wa_test_results.zip
Sign in to reply to this post

Jason ByrnesWebAssist

1) on the search page, you will need to edit the names of the multiple select lists, add "[]" at the end. for example, change the "Center_Name" select list:

php:
<select name="Center_Name" size="10" multiple="MULTIPLE" class="formItem" id="Center_Name">



to:

php:
<select name="Center_Name[]" size="10" multiple="MULTIPLE" class="formItem" id="Center_Name">




2) on the results page, add the following at line 1:

php:
<?php

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

erin4435

Thanks again, that helped some. Now, it is properly pulling results to only include proper matches when more than one search parameter is chosen, but, if I try to select multiple options from one search criteria it will only show the last selected. For instance, the Center Name option has about 70 centers. Is there a way to be able to select 5 of those centers, and only display those in the results? Thanks for any direction or clarification.

Attached Files
wa_test_results.zip
Sign in to reply to this post

Jason ByrnesWebAssist

Like i said in my initial replay, the code change is only a part of it. in the Data Assist Search behavior, you need to make sure that the criteria use the Keyword type, and set the Or seperator to use a comma and a space:
", "


  In the data assist search behavior, you also need to set the criteria that is using the select list to a Keyword criteria type, and set the OR separator to use a comma followed by a space:
", "  




open the results page. go to the server behaviors panel and Doable Click the Data Assist search server behavior. Edit each criteria that uses a multi select list, set the Criteria type to Keyword and the set the OR separator to:
", " (without the quotes)

Sign in to reply to this post

erin4435

I apologize for making that mistake, but I have attempted to change this last bit in the Server Behavior, and I am still not getting the changed results. I am afraid I might not understand what needs to be changed to ", ". I have restored my results page to the original code, and have attached it as txt file. Is there any way I could get some clarity as to what would actually change in the criteria?

Attached Files
Results Page.txt
Sign in to reply to this post

Jason ByrnesWebAssist

make sure the filter type is set to "Keyword" and for the Keyword OR setting use a comma followed by a space.

see the attached screen shot

Sign in to reply to this post

erin4435

Thank you for clarifying that. Unfortunately, that's what I have been trying. With it set exactly like your screen shot, I receive an error that says 'Please ensure that the value entered for "Implied And" is not contained in the value for "Implied OR".'

Also, when I attempt to make any changes to the filter, it resets itself back to how it was originally. Any explanation for this? Thanks for your help!

Sign in to reply to this post

Jason ByrnesWebAssist

use something besifes a space for the Keyword and setting, try entering "AND"

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