PDA

View Full Version : DataAssist Search in conjunction with empty menu pick doesn't work


Tom M
04-04-2009, 01:43 PM
The Data Assist script that handles searches doesn't seem to handle the case of a Drop-Down Menu Label with no value as would seem to be the reasonable way to handle it.

Here are some steps to demonstrate the issue I am having:



I have a search form created by Data Assist where a field, say "Color", is originally specified as a Text Field whose ID and Name is "S_Color".



If the value is blank, then the search result is all colors. This is the correct behavior



I remove the text field and replace it with a Drop-down menu using the Dreamweaver interface, I give this new menu the ID and Name of "S_Color" but don't populate the menu with any Labels-Values



I can now do a search and the result is again all colors. This is the correct behavior



I populate the menu list with the following Label-Value pairs:



Select a Color-
Red-Red
Blue-Blue
Green-Green

Note that the "Select a Color" label doesn't have a value


Now if I execute a search, but choose "Select a Color", I would expect to again see all colors. Instead the search returns nothing. This is the incorrect behavior.



If I go into Dreamweaver code view and specify a value="" for the "Select a Color" label ( i.e. Replace <option>Select a Color</option> with <option value="">Select a Color</option>), then the search will return all colors, the correct result.


Am I missing something?

TM

Ray Borduin
04-06-2009, 07:35 AM
That is correct. If you leave a value blank it will behave as if the label is the value. You have to specifically set value=""

Tom M
04-06-2009, 07:42 AM
Sorry for my ignorance. Is that a standard HTML behavior or is it an artifact of the WA Search implementation?

Thanks,

TM

Ray Borduin
04-06-2009, 10:56 AM
Standard html... has nothing to do with WA Search other than when WA Search gets the value of that form element using standard practices, that is what it gets.