Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
0

Recordset question

Community Beginner ,
Mar 28, 2008 Mar 28, 2008

Copy link to clipboard

Copied

Noob question here. Couldn't find answer in the archives.

I can use the AND and/or OR statements all day long fine for simple filter
results.

Now I have a search form where there are several drop down fields to filter
with. I need to be able to have one user search maybe search with the Country
and State dropdowns, whereas another user might want to search using the
Gender and Height dropdowns.

In short, is there a way to create a recordset that will allow me to filter by
all, some and/or one dropdown depending on the users wishes? I see it done in
websites all the time but am not sure how it's handled.
TOPICS
Server side applications

Views

297
Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Mar 30, 2008 Mar 30, 2008

Copy link to clipboard

Copied

I'm not sure if this is right. but have you tried creating four record sets and then an if statement on the submit button to test and see what drop down menu they used. depending on that it would run the appropriate recordset.

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Mar 30, 2008 Mar 30, 2008

Copy link to clipboard

Copied

Actually just figured it out a few minutes ago. Thanks for the reply. Here's what I found out:

"Issues in Coldfusion referencing #form.checkbox#
and in PHP referecning <?php echo $_POST["checkbox"]; ?>

Please note that in Coldfusion and PHP, a checkbox within a form is not submitted in the request when it is not checked. Any QueryBuilder application in these languages that references a checkbox and makes a comparison against its unchecked value causes an error on the page, as the request will not contain the appropriate checkbox reference."

I changed the checkboxes to drop downs and the sreach/results work fine. I need to do some more reseacrh and find a fix for the checkbox issue. Ever heard of this? Know a workaround?

Regards,
Jared

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Mar 31, 2008 Mar 31, 2008

Copy link to clipboard

Copied

LATEST
FWDWLVR wrote:
> I changed the checkboxes to drop downs and the sreach/results work fine. I
> need to do some more reseacrh and find a fix for the checkbox issue. Ever heard
> of this? Know a workaround?

This is true of checkboxes, radio buttons, and multiple-select menus. If
no value is selected, the form data contains no reference to them.

The solution is to set a default value after the form has been
submitted. In PHP, you do it like this:

<?php $_POST['checkbox'] = isset($_POST['checkbox']) ?
$_POST['checkbox'] : 'default value'; ?>

--
David Powers, Adobe Community Expert
Author, "The Essential Guide to Dreamweaver CS3" (friends of ED)
Author, "PHP Solutions" (friends of ED)
http://foundationphp.com/

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines