|
| |
|
|
A1234
Posts: 101 Joined: 10/7/2004 Status: offline
|
Using % to show all results - 3/9/2005 8:41:44
I forgot how to do this :( I want to give an option to "show all states" in the search options. I created a drop-down box with each state and then created one option to "show all states" with % as the value. However, it does not seem to be working. Apparently I missed a step in there somewhere. What do I need to get this to show all states?
|
|
|
|
Giomanach
Posts: 6129 Joined: 11/19/2003 From: England Status: offline
|
RE: Using % to show all results - 3/9/2005 9:39:51
Can you show us the ASP used to pull the records?
_____________________________
|
|
|
|
A1234
Posts: 101 Joined: 10/7/2004 Status: offline
|
RE: Using % to show all results - 3/9/2005 9:56:05
I haven't listed all the states in the drop-downs yet, just s few to do a test run...but here is the form code (there are two drop down search boxes) <form BOTID="0" METHOD="POST" action="loads.asp"> <input type="hidden" name="fpdbr_0_PagingMove" value=" |< "> <table BORDER="0"> <tr> <td><b>Origin State</b></td> <td><select size="1" name="OriginState"> <option value="Select State" selected>Select State </option> <option value="%">All States</option> <option value="Alaska">Alaska</option> <option value="Alabama">Alabama</option> <option value="<%=Server.HtmlEncode(Request("OriginState"))%>"><%=Server.HtmlEncode(Request("OriginState"))%> </option> </select></td> </tr> <tr> <td><b>Destination State</b></td> <td><select size="1" name="DestinationState"> <option selected>Select State</option> <option value="All States">All States</option> <option value="Alaska">Alaska</option> <option>Alabama</option> <option value="<%=Server.HtmlEncode(Request("DestinationState"))%>"><%=Server.HtmlEncode(Request("DestinationState"))%> </option> </select></td> </tr> </table> <br> <input TYPE="Submit"><input TYPE="Reset"><!--webbot bot="SaveAsASP" clientside suggestedext="asp" preview=" " startspan --><!--webbot bot="SaveAsASP" endspan --></form>
|
|
|
|
Giomanach
Posts: 6129 Joined: 11/19/2003 From: England Status: offline
|
RE: Using % to show all results - 3/9/2005 10:11:56
The form: <form BOTID="0" METHOD="POST" action="loads.asp"> <input type="hidden" name="fpdbr_0_PagingMove" value=" |< "> <table BORDER="0"> <tr> <td><b>Origin State</b></td> <td><select size="1" name="OriginState"> <option value="Select State" selected>Select State</option> <option value="">All States</option> <option value="Alaska">Alaska</option> <option value="Alabama">Alabama</option> <option value="<%=Server.HtmlEncode(Request("OriginState"))%>"><%=Server.HtmlEncode(Request("OriginState"))%> </option> </select></td> </tr> <tr> <td><b>Destination State</b></td> <td><select size="1" name="DestinationState"> <option selected>Select State</option> <option value="">All States</option> <option value="Alaska">Alaska</option> <option>Alabama</option> <option value="<%=Server.HtmlEncode(Request("DestinationState"))%>"><%=Server.HtmlEncode(Request("DestinationState"))%> </option> </select></td> </tr> </table> <br> <input type="Submit"><input TYPE="Reset"><!--webbot bot="SaveAsASP" clientside suggestedext="asp" preview=" " startspan --><!--webbot bot="SaveAsASP" endspan --></form> Form Process: <% 'Pull Values From Frm strDestination=Request.Form("DestinationState") strOrigin=Request.Form("OriginState") 'Set Statement to allow for wildcards if strDestination="" then strDestination= "%" End if if strOrigin="" then strOrigin = "%" End if 'Use FP Recordset to set SQL Query, using LIKE for wildcards. fp_sQry="SELECT * FROM Results WHERE (OriginState LIKE '" & strOrigin & "') OR (DestinationState LIKE '" & strDestination & "')" fp_sDefault="OriginState=Null&DestinationState=Null" fp_sNoRecords="No records returned." fp_sDataConn="postload" fp_iMaxRecords=256 fp_iCommandType=1 fp_iPageSize=25 fp_fTableFormat=False fp_fMenuFormat=False fp_sMenuChoice="OriginState" fp_sMenuValue="OriginState" fp_sColTypes="&UserName=202&ID=3&LoadID=202&OriginState=202&OriginCity=202&DestinationState=202&DestinationCity=202&Miles=202&Rate=202&LoadDate=202&Equipment=202&ContactName=202&ContactPhone=202&Remote_computer_name=202&User_name=202&Browser_type=202&Timestamp=135&" fp_iDisplayCols=10 fp_fCustomQuery=False BOTID=0 fp_iRegion=BOTID %> The bits I've altered are in bold HTH
_____________________________
|
|
|
|
A1234
Posts: 101 Joined: 10/7/2004 Status: offline
|
RE: Using % to show all results - 3/9/2005 10:22:06
Thanks! I got everything done, except the following (i'm not sure where to place this) Form Process: <% 'Pull Values From Frm strDestination=Request.Form("DestinationState") strOrigin=Request.Form("OriginState") 'Set Statement to allow for wildcards if strDestination="" then strDestination= "%" End if if strOrigin="" then strOrigin = "%" End if
|
|
|
|
A1234
Posts: 101 Joined: 10/7/2004 Status: offline
|
RE: Using % to show all results - 3/9/2005 11:13:24
I replaced the code with the info that you provided but it still isn't showing all states :( The page is located at www.nadras.com/loads.asp, if you want to have a look. There is one record in the database right now (alaska). Thx again
|
|
|
|
Giomanach
Posts: 6129 Joined: 11/19/2003 From: England Status: offline
|
RE: Using % to show all results - 3/9/2005 11:22:55
fp_sQry="SELECT * FROM Results WHERE (OriginState LIKE '" & strOrigin & "') AND (DestinationState LIKE '" & strDestination & "')" Replace that line with what I've given there
_____________________________
|
|
|
|
jmlbige
Posts: 62 Joined: 7/22/2004 Status: offline
|
RE: Using % to show all results - 3/9/2005 12:44:12
Try this... In your DRW click on "More Options" and the "Criteria". From there make sure you have Comparison set to "Contains"
|
|
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
|
|
|