dropdown lists

M

matt shudy

Hi,

Is there a way to give a choice in a dropdown list more
than one value? I have a search page and want to be able
to search by location and year. It works fine when I
search be location and a specific year but not when I try
to search using all years. Is there a way to have two
values ex. 2003, 2004. Then just keep adding years... So
it will search for all possible years.

Thanks,

Matt
 
C

Cowboy \(Gregory A. Beamer\)

With a textarea (multi-line text box), it is possible. With a drop down,
there is a limitation in HTML.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA
Author: ADO.NET and XML: ASP.NET on the Edge

****************************************************************************
****
Think Outside the Box!
****************************************************************************
****
 
S

Stephen Travis

You could use an IN clause in your query to select specific years or use the % wildcard for all years (converting the year to text
if necessary)
 
S

Stephen Travis

<select size="1" name="Year">
<option selected value="%">All Years</option>
<option value="2001">2001</option>
</select>

SELECT * FROM TableName WHERE Year LIKE '::year::'

If the db Year is numeric;

SELECT * FROM TableName WHERE CStr(Year) LIKE '::year::'
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top