Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    Regular Coder MaDmiX's Avatar
    Join Date
    Feb 2012
    Location
    Charlotte, NC
    Posts
    160
    Thanks
    40
    Thanked 0 Times in 0 Posts

    Setting a checkbox to null???

    Hi All,

    Not sure if this is the right forum to post to but here goes:

    I have a form which posts some values that are used in a query. Some of my form fields are checkboxes. If a box is checked then the query returns records where that box is checked, otherwise it returns all of the records for that checkbox (checked or unchecked). My problem is that if the user runs the query again and unchecks a previously checked box, the query returns records as if that box were still checked.

    I tried setting a "triple-state" checkbox as described on another site but that did not work. I also tried creating a "reset form" button but no luck.

    Any help is always appreciated.

    Thanks in advance,

    Ken

  • #2
    Regular Coder
    Join Date
    Apr 2012
    Location
    St. Louis, MO
    Posts
    985
    Thanks
    7
    Thanked 101 Times in 101 Posts
    If the checkbox is not checked, it does not exist in the form object when submitted, so there has to be something else caching or otherwise remembering that element. Is the form being submit GET or POST?
    ^_^

    If anyone knows of a website that can offer ColdFusion help that isn't controlled by neurotic, pedantic jerks* (stackoverflow.com), please PM me with a link.
    *
    The neurotic, pedantic jerks are not the owners; just the people who are in control of the "popularity contest".

  • #3
    Regular Coder MaDmiX's Avatar
    Join Date
    Feb 2012
    Location
    Charlotte, NC
    Posts
    160
    Thanks
    40
    Thanked 0 Times in 0 Posts
    Hi WolfShade,

    Yes, the form fields are being POSTed to session varibles. I did this so that I could get recordset paging to work for my query results. I prefer not to use session variables but this is the only way I could get the paging to work.

    Ken

  • #4
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    25,020
    Thanks
    75
    Thanked 4,323 Times in 4,289 Posts
    Okay, so this has NOTHING to do with JavaSript and EVERYTHING to do with errors in your server-side coding. So post to the forum that covers the server-side language you are using.

    And when you do so, POST YOUR CODE. Nobody can guess what your bug is when you don't show your code.
    An optimist sees the glass as half full.
    A pessimist sees the glass as half empty.
    A realist drinks it no matter how much there is.

  • #5
    Regular Coder MaDmiX's Avatar
    Join Date
    Feb 2012
    Location
    Charlotte, NC
    Posts
    160
    Thanks
    40
    Thanked 0 Times in 0 Posts
    Will do.


  •  

    Posting Permissions

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