Hello, I have another problem. My thesis advisor ask me to make like this:
In my previous program, I make 1 drop down menu which consist of author, dates, category,etc.
If it looks like that, I just need 1 variable which is name of drop down menu.
Now, I was asked to make like this:
I have some check box which are: check box for author, check box for dates, check box for category, etc.
If I tick author, and type keyword "xyz" then the program only search for keyword "xyz" in scope author. The same condition if I want to tick author, category and title with keyword "xyz". Then, the program only search for keyword "xyz" in scope author, category and title.
Does anyone can help me?
Here is my ASP code:
Code:
<%
a=Request.Form("desc_id")
b=Request.Form("title")
c=Request.Form("dates")
d=Request.Form("author")
e=Request.Form("file_name")
f=request.Form("type")
g=Request.Form("category")
h=Request.Form("status")
i=Request.Form("year")
C_prefix = "contains("& f & ",'"
C_midfix = "') or contains("& f &",'"
C_suffix = "')"
Function CreateContainsList( fromStr )
Dim temp, re
' the regexp ensures that multiple spaces become single spaces
Set re = New RegExp
re.Pattern = "\s+"
re.Global = True
' so get an array of words via split...
temp = Split( re.Replace( Trim(fromStr), " " ), " " )
' and make it into the contains list via join and helpers
CreateContainsList = C_prefix & Join( temp, C_midfix ) & C_suffix
End Function
demo = request.Form("txtSearch")
%>
and here is the path :
Code:
path="form/document[<%= CreateContainsList(request.Form("txtSearch"))%>]//*";
In this code:
C_prefix = "contains("& f & ",'"
C_midfix = "') or contains("& f &",'"
C_suffix = "')"
It will run only the variable is "f" if I click checkbox "type". But, how if I want to make it does not static like that? So, If I click checkbox "category", variable "f" change into variable "g" (depends on which checkbox that user click).
Thank you