matching a querystring to a checkbox field?

Ask a Question related to Dreamweaver AppDev, Design and Development.

  1. #1

    Default matching a querystring to a checkbox field?

    Hi,

    (ASP/VBScript, Access, DWMX)

    I have a page that has a set of links


    <a href="resultspage.asp?residential=1">Residential</a>
    <a href="resultspage.asp?commercial=1">Commercial</a>

    These links point to an ASP results page, which has a recordset that
    contains data from a table in Access that has checkboxes for Residential,
    Commerical, Lease etc. I'm having trouble establishing what my SELECT
    statement should be on the results page...

    SELECT *
    FROM datatable
    WHERE residential = varResidential OR commercial = varCommercial

    varResidential 0 Request.QueryString("residential")
    varCommercial 0 Request.QueryString("commercial")

    Problem is, when I click one of the links, it is showing me both Residential
    and Commercial? I had assumed that, if I only passed 1 variable through the
    querystring, it would assume that all other values would be 0 (Default
    Value), and therefore would not show them?

    I know I'm making a mountain out of a mole hill here, so what is the best
    way to do this?

    Thanks, in advance, for any help offered.
    Regards
    Nath.



    Nathon Jones Guest

  2. Similar Questions and Discussions

    1. Disable checkbox when field value = null
      Hi, I try to disable /hide datagrid checkbox when the value of the field is null, I have try to put some code in ItemDataBound to invisible...
    2. Howto bind CheckBox to the datagrid/ Then update the database field when the checkbox is clicked.
      I am trying to update the database field when the checkbox is clicked. I am trying to modified the following solution but.. got stuck on the...
    3. Show Field based on Checkbox
      ASP/ACCESS I have a table that contains user data (e.g. username, password, email, etc.) along with some checkboxes that signify whether or not a...
    4. Updating an Access DB Yes/No field with a Checkbox value
      I have a DataGrid that is configured to use the Edit/Update/Cancel concept correctly. My grid shows values from 5 database fields. I only need to...
    5. Checking a checkbox based upon a table field
      I have a template column in my grid that displays a checkbox. I would like to have the box checked if a field in the table that the grid is based...
  3. #2

    Default Re: matching a querystring to a checkbox field?

    > SELECT *
    > FROM datatable
    > WHERE residential = varResidential OR commercial = varCommercial
    >
    > Problem is, when I click one of the links, it is showing me both
    Residential
    > and Commercial?
    What I usually do is add a response.write to my page:

    response.write (myQueryString)

    and then run the page to see exactly what is being passed to the database.

    -Darrel


    darrel Guest

Posting Permissions

  • You may not post new threads
  • You may 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