This topic is locked

Advanced Search, Combo box, equal only

5/25/2005 2:25:51 PM
ASPRunnerPro General questions
Alberto author

Hi Sergey,

In the advanced Search tool, that now has the dropdown boxes to select the items to search for, we are allowed to search for only EQUALS and NOT for any of the rest of the possible conditions which are fundamental and allow expanding the search criterion.
Please allow us, having the drop down boxes, to search for using the other conditions like between, >, <, >=, <= etc. that would be a big plus.
Know Sergey, if we can have drop down boxes and the chance to type something there to search for would be the best.
Thanks

Sergey Kornilov admin 5/26/2005

Alberto,
you need to modify Sub WriteSearchOptions(sFormat, sValue) function in ..._search.asp
See my changes in bold:

Sub WriteSearchOptions(sFormat, sValue)

if sFormat="" then sFormat=EDIT_FORMAT_TEXT_FIELD 

Response.Write "<SELECT ID=""SearchOption"" NAME=""SearchOption"" SIZE=1 onChange=""return ShowHideControls();"">"

if sFormat=EDIT_FORMAT_TEXT_FIELD or sFormat = EDIT_FORMAT_HIDDEN or sFormat = EDIT_FORMAT_READONLY or sFormat =EDIT_FORMAT_LOOKUP_WIZARD then Response.Write "<OPTION VALUE=""Contains"" " & iif(sValue="Contains", " selected ", "") & ">" & ##SCRIPTMESSAGE(CONTAINS)## & "</option>"

Response.Write "<OPTION VALUE=""Equals"" " & iif(sValue="Equals", " selected ", "") & ">" & ##SCRIPTMESSAGE(EQUALS)## & "</option>"

if sFormat=EDIT_FORMAT_TEXT_FIELD or sFormat = EDIT_FORMAT_HIDDEN or sFormat = EDIT_FORMAT_READONLY or sFormat =EDIT_FORMAT_LOOKUP_WIZARD then Response.Write "<OPTION VALUE=""Starts with ..."" " & iif(sValue="Starts with ...", " selected ", "") & ">" & ##SCRIPTMESSAGE(STARTS_WITH)## & "</option>"

if sFormat=EDIT_FORMAT_TEXT_FIELD or sFormat=EDIT_FORMAT_DATE or sFormat = EDIT_FORMAT_HIDDEN or sFormat = EDIT_FORMAT_READONLY or sFormat =EDIT_FORMAT_LOOKUP_WIZARD then Response.Write "<OPTION VALUE=""More than ..."" " & iif(sValue="More than ...", " selected ", "") & ">" & ##SCRIPTMESSAGE(MORE_THAN)## & "</option>"

if sFormat=EDIT_FORMAT_TEXT_FIELD or sFormat=EDIT_FORMAT_DATE or sFormat = EDIT_FORMAT_HIDDEN or sFormat = EDIT_FORMAT_READONLY or sFormat =EDIT_FORMAT_LOOKUP_WIZARD then Response.Write "<OPTION VALUE=""Less than ..."" " & iif(sValue="Less than ...", " selected ", "") & ">" & ##SCRIPTMESSAGE(LESS_THAN)## & "</option>"

if sFormat=EDIT_FORMAT_TEXT_FIELD or sFormat=EDIT_FORMAT_DATE or sFormat = EDIT_FORMAT_HIDDEN or sFormat = EDIT_FORMAT_READONLY or sFormat =EDIT_FORMAT_LOOKUP_WIZARD then Response.Write "<OPTION VALUE=""Equal or more than ..."" " & iif(sValue="Equal or more than ...", " selected ", "") & ">" & ##SCRIPTMESSAGE(EQUAL_OR_MORE)## & "</option>"

if sFormat=EDIT_FORMAT_TEXT_FIELD or sFormat=EDIT_FORMAT_DATE or sFormat = EDIT_FORMAT_HIDDEN or sFormat = EDIT_FORMAT_READONLY or sFormat =EDIT_FORMAT_LOOKUP_WIZARD then Response.Write "<OPTION VALUE=""Equal or less than ..."" " & iif(sValue="Equal or less than ...", " selected ", "") & ">" & ##SCRIPTMESSAGE(EQUAL_OR_LESS)## & "</option>"

if sFormat=EDIT_FORMAT_TEXT_FIELD or sFormat=EDIT_FORMAT_DATE or sFormat = EDIT_FORMAT_HIDDEN or sFormat = EDIT_FORMAT_READONLY or sFormat =EDIT_FORMAT_LOOKUP_WIZARD then Response.Write "<OPTION VALUE=""Between"" " & iif(sValue="Between", " selected ", "") & ">" & ##SCRIPTMESSAGE(BETWEEN)## & "</option>"

if sFormat=EDIT_FORMAT_TEXT_FIELD or sFormat=EDIT_FORMAT_DATE or sFormat = EDIT_FORMAT_HIDDEN or sFormat = EDIT_FORMAT_READONLY or sFormat =EDIT_FORMAT_LOOKUP_WIZARD then Response.Write "<OPTION VALUE=""IsNull"" " & iif(sValue="IsNull", " selected ", "") & ">" & ##SCRIPTMESSAGE(EMPTY)## & "</option>"

Response.Write "</SELECT>"
End Sub