Forum Moderators: open

Message Too Old, No Replies

detecting unclicked checkbox

         

mpevah1

8:50 pm on Oct 8, 2003 (gmt 0)

10+ Year Member



how can I detect when a user unclicks a checkbox? my onclick only detectes when the box is clicked, I've been told this is wrong so I can post my code if need be.

Thanks.

claus

9:03 pm on Oct 8, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



To detect an unclicked checkbox, you have to use the property "checked", pseudocode:

------------------------------------------

if (document.forms[0].checkbox[1].checked == false) {
...
}

------------------------------------------

/claus


BTW: Welcome to WebmasterWorld mpevah1 :)

DrDoc

9:11 pm on Oct 8, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



you can check whether it's checked or not...

Hmm, not good to have reply window open for too long ;)

mpevah1

9:24 pm on Oct 8, 2003 (gmt 0)

10+ Year Member



Thanks! That worked. I guess it was firing but for some reason it wasn't checking if the table was hidden (which is what the checkbox does). but once I changed it to look at the status of the checkbox it worked like a charm!