|
| |
|
|
99bird
Posts: 15 Joined: 3/19/2004 Status: offline
|
Search and results page help - 9/21/2007 14:50:02
After searching this forum until my eyes have crossed. I am looking for a good sample, example or tutorial that would give me and idea on how to do a search page that would have 3 dynamic independent dropdown boxes and a "fuzzy" search box that would post the results to the same page. An example would be (1) dropdown to search for a category (2) dropdown to search by collection (3) dropdown to search by designer (4) text " fuzzy" (like) search box to be able search by entering a category name, a collection name, designers name or a model number or model number prefix. Thanks to everyone in advance for your help and assistance.
|
|
|
|
rdouglass
Posts: 9280 From: Biddeford, ME USA Status: offline
|
RE: Search and results page help - 9/24/2007 8:20:03
The dropdowns are fairly straightforward and are found a lot of places. I'm surprised you didn't find one. Try searching just for 'dropdown' in the ASP forum and I'm sure you'll find a few. If not, let me know and I'll find some. Item #4 is probably your big issue and I have answered that Q a few times. It essentially boils down to building the SQL on the fly. Building the SQL can look something like this: <%DIM myQuerystring
myQuerystring = ""
IF trim(Request.Form("FirstName" )&"") > "" THEN
myQuerystring = " (firstName = ' " & IF Request.Form("FirstName" ) & " ' )"
END IF
IF trim(Request.Form("LastName" )&"" > "" THEN
' check to see if myQuerystring has anything in it
IF myQuerystring > "" THEN
myQuerystring = myQuerystring & " AND "
END IF
myQuerystring = myQuerystring & " (lastName = '" & IF Request.Form("LastName" ) & "' )"
END IF
IF trim(Request.Form("State" )&"") > "" THEN
' check to see if myQuerystring has anything in it
IF myQuerystring > "" THEN
myQuerystring = myQuerystring & " AND "
END IF
myQuerystring = myQuerystring & " (state = '" & IF Request.Form("State" ) & "' )"
END IF
IF trim(Request.Form("Title" )&"") > "" THEN
' check to see if myQuerystring has anything in it
IF myQuerystring > "" THEN
myQuerystring = myQuerystring & " AND "
END IF
myQuerystring = myQuerystring & " (title = '" & IF Request.Form("Title" ) & "' )"
END IF
mySQL = "SELECT * FROM myTable" & myCriteria
%>
That help any?
_____________________________
Don't take you're eye off your final destination. ASP Checkbox Function Tutorial.
|
|
New Messages |
No New Messages |
Hot Topic w/ New Messages |
Hot Topic w/o New Messages |
Locked w/ New Messages |
Locked w/o New Messages |
|
Post New Thread
Reply to Message
Post New Poll
Submit Vote
Delete My Own Post
Delete My Own Thread
Rate Posts
|
|
|