Forum Moderators: open

Message Too Old, No Replies

What value for a drop down menu to show a field

with anything in it?

         

dickbaker

10:21 pm on May 28, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I hope this will make sense. I have a database with several fields: paragraph one, paragraph two, paragraph three, etc. Some of these fields contain brand names that I want users to be able to search via a drop-down menu. A couple of other fields I want to be found only if they contain any data at all.

So, my query would be something like "Select from my_database WHERE (paragraphone LIKE '%parameter_one%' OR paragraphtwo LIKE '%parameter_one%' OR paragraphthree LIKE '%parameter_one%' "

Parameter_one would be the value of Request.Form("my_dropdown")

Is there any value I can give to the drop-down menu for the paragraphs that I want to be found if they contain _any_data at all?

Any replies much appreciated.

TheNige

11:10 pm on May 28, 2004 (gmt 0)

10+ Year Member



I'm not exactly sure what you are asking...but for a drop down you can give it a different value that the text displayed

<select>
<option value="Company1">Test Company Name</option>
</select>

is this what you are asking?

f00sion

3:29 am on May 29, 2004 (gmt 0)

10+ Year Member



if you make the dropdown value just an empty string then it should work fine to return all the rows..so when the statement is put together it would like like: paragraphone like '%%'

dickbaker

7:56 pm on May 29, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Thanks for the replies. One of the fields is for my subscribers to describe their target shooting ranges, if they have them. Since "range" shows up in other paragraphs on many of the subscribers' pages--ie, "we carry a wide range of archery suppies"--I guess I'll have to make sure that each one that has a target range mentions the numer of bays they have. That way, I can use "bay" as the value for Range.

Any other, more elegant solutions much appreciated.

raywood

2:24 pm on May 30, 2004 (gmt 0)

10+ Year Member



If you fill your dropdown list with a query from the database it should always contain only the items present in the database. That way you don't have to be going in and fixing the dropdown list when the database changes.