Professional Web Applications Themes

Display Search Parameters - Dreamweaver AppDev

Hi I have 4 drop down menus on and users cans search a sql database by selecting a item from any of these drop down menus. In order to get the results page to ignore non selected drop down menu I have a ALL field in all the drop menus with a value of %. The other items all have values of the ID field in the database. The search works fine but I want the search parameters to appear in the results page as well. E.g. if a users searches for Manufacturer "BioKit", it will display the ID of ...

  1. #1

    Default Display Search Parameters

    Hi

    I have 4 drop down menus on and users cans search a sql database by selecting
    a item from any of these drop down menus.

    In order to get the results page to ignore non selected drop down menu I have
    a ALL field in all the drop menus with a value of %. The other items all have
    values of the ID field in the database.

    The search works fine but I want the search parameters to appear in the
    results page as well.

    E.g. if a users searches for Manufacturer "BioKit", it will display the ID of
    Biokit and the rest of the values will say %

    Any way I can get around this

    thanks

    patelajk Guest

  2. #2

    Default Re: Display Search Parameters

    You could check for the value passed, and then if it is % then show
    something else,

    Dim Searchbox1
    Dim Searchbox2
    Dim Searchbox3
    Dim Searchbox 4

    'I am assuming your form is using PUT and not GET, if it is using GET then
    change Request.Form
    'to Request.Querystring
    Searchbox1 = Request.Form("searchbox1")
    Searchbox2 = Request.Form("searchbox2")
    Searchbox3 = Request.Form("searchbox3")
    Searchbox4 = Request.Form("searchbox4")

    If Searchbox1 = "%" Then
    Searchbox1 = "All"
    End If

    If Searchbox2 = "%" Then
    Searchbox2 = "All"
    End If

    If Searchbox3 = "%" Then
    Searchbox3 = "All"
    End If

    If Searchbox4 = "%" Then
    Searchbox4 = "All"
    End If

    This will check to see if any of the search values were %, if so, it will
    make the variable "All" instead. You will have to replace your current
    display variable with the Searchbox1...4

    Hope this helps,
    Drew


    "patelajk" <com> wrote in message
    news:dc2b3m$mah$macromedia.com... 


    Drew Guest

  3. #3

    Default Re: Display Search Parameters

    My above post is assuming that you are using ASP (classic, not .NET) with
    VBScript.

    Drew

    "patelajk" <com> wrote in message
    news:dc2b3m$mah$macromedia.com... 


    Drew Guest

  4. #4

    Default Re: Display Search Parameters

    Drew

    Thanks for the help so far,

    Priviously i had <%=Request.querystring("dropdown1") %>

    Do you know what I have to replace this with
    patelajk Guest

  5. #5

    Default Re: Display Search Parameters

    The code below should help you out. Just replace the searchbox1-searchbox4
    (in the Request.Querystring("searchbox1") to your form element names. Then
    replace the display code with <%=Searchbox1%>, etc.

    <%
    Dim Searchbox1
    Dim Searchbox2
    Dim Searchbox3
    Dim Searchbox 4

    Searchbox1 = Request.Querystring("searchbox1")
    Searchbox2 = Request.Querystring("searchbox2")
    Searchbox3 = Request.Querystring("searchbox3")
    Searchbox4 = Request.Querystring("searchbox4")

    If Searchbox1 = "%" Then
    Searchbox1 = "All"
    End If

    If Searchbox2 = "%" Then
    Searchbox2 = "All"
    End If

    If Searchbox3 = "%" Then
    Searchbox3 = "All"
    End If

    If Searchbox4 = "%" Then
    Searchbox4 = "All"
    End If
    %>



    "patelajk" <com> wrote in message
    news:dca5po$no8$macromedia.com... 


    Drew Guest

  6. #6

    Default Re: Display Search Parameters

    Thanks Drew Works a treat
    patelajk Guest

  7. #7

    Default Re: Display Search Parameters

    Very welcome... I just hope that I can help people in this group as much as
    others have helped me!

    Drew

    "patelajk" <com> wrote in message
    news:dcdc1r$fo9$macromedia.com... 


    Drew Guest

Similar Threads

  1. Parsing Search Parameters
    By Charles R. Thompson in forum Coldfusion - Advanced Techniques
    Replies: 0
    Last Post: May 3rd, 01:47 PM
  2. Searching with multiple search parameters PHP
    By vaene in forum Dreamweaver AppDev
    Replies: 1
    Last Post: April 4th, 08:21 AM
  3. Cfgrid to display search results
    By grice in forum Coldfusion Flash Integration
    Replies: 2
    Last Post: March 24th, 02:11 PM
  4. Search and display in same form
    By Marshall Barton in forum Microsoft Access
    Replies: 0
    Last Post: July 28th, 04:56 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139