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: no ratings, 0 total Votes
Categories: HTML DOM javascript web
Added: on Oct 01, 2007 at 4:01 pm
Added By: an anonymous user

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

100% positive, 0 comments
– Tip added by rlansky on Jun 22, 2007 at 9:34 am

Telling when an iframe is done loading

100% positive, 0 comments
– Tip added by an anonymous user on Apr 18, 2008 at 8:05 am

Static variables in Javascript

100% positive, 2 comments - last added on May 08, 2008 at 4:19 pm
– Tip added by an anonymous user on Aug 03, 2007 at 4:19 pm

Always use the label attribute when creating radio buttons or checkboxes in forms

Categories: HTML CSS coding web
100% positive, 1 comment - last added on Mar 14, 2007 at 2:44 pm
– Tip added by Marcos84 on Mar 14, 2007 at 1:44 pm

All-in-one code reference for PHP, JavaScript, CSS, Ruby, Python/SQL, etc.

100% positive, 1 comment - last added on May 08, 2007 at 4:46 pm
– Tip added by an anonymous user on May 08, 2007 at 4:15 pm

shorten URLs using tinyurl

Categories: Computers web HTML email
100% positive, 1 comment - last added on Mar 31, 2007 at 3:11 pm
– Tip added by an anonymous user on Mar 30, 2007 at 1:32 pm

getting rounded corners without using background images

100% positive, 0 comments
– Tip added by tipstr on Mar 13, 2007 at 10:35 am

Smooth scrolling for anchor links

100% positive, 1 comment - last added on Mar 12, 2007 at 9:09 am
– Tip added by Marcos84 on Mar 11, 2007 at 9:24 am

The best HTML/CSS/Javascript reference

100% positive, 2 comments - last added on Mar 09, 2007 at 7:36 pm
– Tip added by Marcos84 on Mar 06, 2007 at 3:22 pm

compressing javascript

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

Wrap web text to any shape

100% positive, 0 comments
– Tip added by an anonymous user on Dec 16, 2007 at 10:35 am

Declaring variables in Javascript

Categories: javascript web
100% positive, 1 comment - last added on Aug 17, 2007 at 8:08 am
– Tip added by an anonymous user on Aug 16, 2007 at 9:54 am

Creating vector graphics in javascript

100% positive, 0 comments
– Tip added by Marcos84 on May 10, 2007 at 2:44 pm

Javascript variable naming

no ratings, 0 comments
– Tip added by an anonymous user on Sep 30, 2007 at 7:28 am

List HTML character entities

no ratings, 0 comments
– Tip added by an anonymous user on Sep 02, 2007 at 8:08 pm

Code for creating Javascript CSS charts

no ratings, 0 comments
– Tip added by an anonymous user on Aug 21, 2007 at 12:23 pm

Efficient building of large strings in Javascript

no ratings, 0 comments
– Tip added by an anonymous user on Aug 08, 2007 at 12:52 pm

Avoid invalid title names when opening javascript windows

no ratings, 0 comments
– Tip added by an anonymous user on Aug 07, 2007 at 9:36 am

Styling browse buttons on file elements in forms

Categories: CSS web 2.0 javascript HTML
no ratings, 0 comments
– Tip added by an anonymous user on May 31, 2007 at 9:13 am

Nice article on javascript techniques

no ratings, 0 comments
– Tip added by rlansky on Apr 24, 2007 at 8:12 am