dropdown lists

  • Thread starter Thread starter matt shudy
  • Start date Start date
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
 
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!
****************************************************************************
****
 
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)
 
<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::'
 
Back
Top