This topic is locked

Search Defaults

6/12/2006 1:59:19 PM
ASPRunnerPro General questions
K
Kym author

Some people are such a menace! You did a great job of getting the forum back up quickly.
Can you tell me how I set a default value for a field in the advanced search page? You had given me the code last month and where to put it but I rebuilt the program and I lost the changes. Regrettably, I did not save it and it is no longer on the forum. Thanks.

Sergey Kornilov admin 6/12/2006

You can try to put the following in the beginning of the search page:

if Session("SearchFor1_" & strTableName & "_FieldName")="" then

Session("SearchFor1_" & strTableName & "_FieldName") = "Default value"

end if
K
Kym author 6/13/2006

Thank you for your help. This code works great for setting the value box but can you tell me how I would set the drop down box to default to "equals" instead of "contains".

J
Jane 6/14/2006

Kym,
open generated ..._list.asp file, locate following code snippet:

<SELECT ID="SearchOption" NAME="SearchOption" SIZE="1">

<OPTION VALUE="Contains">Contains</option>

<OPTION VALUE="Equals">Equals</option>



and replace it with this one:

<SELECT ID="SearchOption" NAME="SearchOption" SIZE="1">

<OPTION VALUE="Equals">Equals</option>

<OPTION VALUE="Contains">Contains</option>