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

Search Page with Multiple Dropdowns

Thread began 7/29/2009 12:19 pm by Kevin373660 | Last modified 8/24/2009 6:55 pm by Ray Borduin | 1498 views | 8 replies |

Kevin373660

Search Page with Multiple Dropdowns

Using DataAssist, I have created Search pages with multiple selectable field option dynamic drop downs from data base table (example: state, countries). Sometimes, I only want to search by one criterion. Currently, the values from the table display in each of the dropdowns.

The field could be just a “text field” but I was hoping to be able to provide a dropdown to allow for a search based on “known/used” values. I have tried with a blank “Select value equal to” in the Dynamic List/Menu. But that did not work.

Without having a “blank” value in the db table, how can I have it display without a value? Then allow using the dropdown to select?

Sign in to reply to this post

Ray BorduinWebAssist

Just add the option to the top of the list:

<option value="" selected>select one</option>

The populate list from array behavior has the option to leave the top option, which you should make sure is properly configured.

Sign in to reply to this post

Kevin373660

Ok, I think I've got the idea. In the Sever Behaviors panel, I double clicked on the Dynamic List/Menu(mytable). Added (+) a "Static options:" with value=value, Label=(blank).

I am using the menu option. I wanted the values to be picked up dynamically from the tabel rather than use a static list? Perhaps I am just confused.

However, I do not seam to be able to get the search form to work. I am trying to debug. Which variable value should the "Select value equal to;" be set to?

Sign in to reply to this post

Ray BorduinWebAssist

You should not set that value.... leave it blank

Sign in to reply to this post

Kevin373660

I know that you are busy but I just wanted to say thank you.

The solution was too obvious. Sorry to bother you, I had try a number of resources, but it was very important to me to find an answer to this small problem. Again, thank you for your kind support and patience.

Sign in to reply to this post

info271221

Initially Selected Menu Item

I have the code you suggested as the first option on this page:
photogallery_Search.php
(I have also attached this page) The problem is that is not initially selecting the select by default and it is not at the top of the list, there is a blank entry at the top.

Sign in to reply to this post

Ray BorduinWebAssist

Add the word "selected" to make an option selected in a list.

What does the code look like that creates the list and what exactly do you want to happen?

Sign in to reply to this post

info271221

Dynamic Menu initially select AND reset

Here is the code I am using for the dynamic menu:
<select name="S_year" id="S_year">
<option selected="selected" value="" <?php if (!(strcmp("", $row_rsPhotoYear['year']))) {echo "selected=\"selected\"";} ?>>Select Year</option>
<?php
do {
?><option value="<?php echo $row_rsPhotoYear['year']?>"<?php if (!(strcmp($row_rsPhotoYear['year'], $row_rsPhotoYear['year']))) {echo "selected=\"selected\"";} ?>><?php echo $row_rsPhotoYear['year']?></option>
<?php
} while ($row_rsPhotoYear = mysql_fetch_assoc($rsPhotoYear));
$rows = mysql_num_rows($rsPhotoYear);
if($rows > 0) {
mysql_data_seek($rsPhotoYear, 0);
$row_rsPhotoYear = mysql_fetch_assoc($rsPhotoYear);
}
?>
</select>

I want to show all records in the database from selected year.

Also the results are not resetting - once you search it does not seem to be resetting.
photogallery_Search.php

Sign in to reply to this post

Ray BorduinWebAssist

Well I guess you should work on one thing at a time. You have a few issues:

1) Your list isn't populated correctly
2) the selections don't stick
3) the filter doesn't refresh

is that correct?

1) is probably an issue with your recordset query. Your list is set up to return the results from that query, so if the results are wrong, then the query in the recordset is probably wrong.

2) Not sure what you want to be selected. You should remove 'selected="selected"' from the first option, it would keep other options from ever being selected.

3) Might be an issue with your trigger that you are using for your filter. How are you filtering it? What is not resetting exactly?

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