Wrox Programmer Forums
Classic ASP XML Using ASP 3 and XML. See also the XML category for more XML discussions not relating to ASP. NOT for ASP.NET 1.0, 1.1, or 2.0
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP XML section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old June 30th, 2008, 12:43 AM
Authorized User
Join Date: Jun 2008
Posts: 46
Thanks: 0
Thanked 0 Times in 0 Posts
Default multi checkbox problem

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:



 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 :
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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Multi Column - HTML printing problem ROCXY HTML Code Clinic 5 March 6th, 2008 10:53 AM
Problem with Multi-select for report parameter JimReid BOOK: Professional SQL Server Reporting Services ISBN: 0-7645-6878-7 0 January 30th, 2007 11:44 AM
Multi Checkbox selection - ASP cancer10 Classic ASP Databases 7 November 21st, 2006 01:00 AM
having problem Using Indexed properties with Multi kris_rathi79 Struts 0 June 27th, 2006 07:56 AM
multi-multi-multiple Insert with subquery??? jmjyiannis SQL Server 2000 1 May 5th, 2006 02:20 PM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.