Tip Details Add a Related Tip

Rate as: Positive Negative

Don't use onChange events for checkboxes

If you want to fire a javascript event when a checkbox is checked in an HTML form, you may be tempted to use the onChange event for the checkbox form element. Don't! While this will work just fine for Firefox and Safari, it will not work consistently for Internet Explorer. If you want to make sure that the event is fired consistently, use the onClick event instead. This works fine across all browsers.
Rating: 100% positive, 3 total Votes
Categories: HTML DOM javascript web
Added: on Oct 01, 2007 at 4:01 pm
Added By: an anonymous user
Searches: event html javascript dom web

Comments on this Tip

Add a Comment
There are no comments for this tip
Your Comment:
(how to format)
Rate This Tip:

Verify Humanity:
Sorry, we know it's annoying, but please enter the characters shown in the image to the left so that we know you're an actual person and not an evil spammer. Thanks.
       

Related Tips

Scrolling HTML elements using the keyboard

80% positive, 1 comment - last added on Jul 18, 2008 at 3:53 pm
– Tip added by rlansky on Jun 22, 2007 at 9:34 am

Telling when an iframe is done loading

85% positive, 3 comments - last added on May 16, 2009 at 7:48 am
– Tip added by an anonymous user on Apr 18, 2008 at 8:05 am

Getting pages to render correctly in IE8

Categories: IE8 web css javascript HTML
100% positive, 0 comments
– Tip added by an anonymous user on Jul 23, 2009 at 10:13 pm

Detecting if a variable exists in Javascript

100% positive, 2 comments - last added on Oct 21, 2009 at 2:29 pm
– Tip added by an anonymous user on Jul 22, 2008 at 8:31 am

Length of associative arrays in Javascript

100% positive, 0 comments
– Tip added by an anonymous user on Nov 04, 2008 at 10:13 am

Enabling right click on web pages

Categories: javascript web security
100% positive, 0 comments
– Tip added by an anonymous user on Jul 19, 2008 at 6:37 am

reading select element values in javascript in IE7

100% positive, 0 comments
– Tip added by an anonymous user on Jul 17, 2009 at 1:28 pm

Optional parameters in javascript functions

100% positive, 0 comments
– Tip added by an anonymous user on Jul 30, 2008 at 10:44 am

Keep websites from disabling right-click menus

100% positive, 0 comments
– Tip added by an anonymous user on Jan 20, 2009 at 8:08 am

Checking for undefined variables in Javascript

100% positive, 1 comment - last added on Jul 14, 2009 at 5:13 pm
– Tip added by an anonymous user on Jan 14, 2009 at 9:47 am

CSS Image Sprites Tutorial - Save Bandwidth Using Better Buttons

Categories: web CSS HTML design
100% positive, 0 comments
– Tip added by an anonymous user on Dec 03, 2008 at 2:08 pm

Copying text from web pages that block copying

100% positive, 0 comments
– Tip added by an anonymous user on Dec 02, 2008 at 12:43 pm

Learn By Doing

100% positive, 1 comment - last added on Oct 25, 2008 at 12:28 pm
– Tip added by an anonymous user on Aug 25, 2008 at 2:00 am

Viewing CSS and Javascript files

100% positive, 0 comments
– Tip added by an anonymous user on Aug 20, 2008 at 7:27 am

How to impress the judges of 2009 Calling All Innovators Contest

no ratings, 0 comments
– Tip added by alvinmood on Jun 12, 2009 at 6:05 am

detecting if a user is logged into Twitter

no ratings, 0 comments
– Tip added by an anonymous user on Jan 07, 2009 at 1:08 pm

Viewing CSS and Javascript source in Firefox

Categories: firefox javascript CSS HTML
no ratings, 0 comments
– Tip added by an anonymous user on Dec 15, 2008 at 10:04 am

Information on the meta expires tag

Categories: business web SEO HTML
no ratings, 0 comments
– Tip added by jacksmith2010 on Dec 09, 2008 at 11:15 pm

attaching events to nodes in Javascript

no ratings, 0 comments
– Tip added by an anonymous user on Aug 18, 2008 at 11:23 am

animating elements with jQuery

0% positive, 0 comments
– Tip added by an anonymous user on Aug 04, 2008 at 1:46 pm