SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Member
    Join Date
    Apr 2006
    Posts
    19
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Solved : Check Box & Alert Fail in IE6

    I simply cannot figure this out. I have a very simple form with a checkbox. The onChange property for the checkbox never gets activated in IE6 on W2K. It works just fine in Safara, Opera, and FF.

    Trying to isolate the problem, I boiled my test down to nothing but a checkbox, label, and an alert. When you click the checkbox, it SHOULD cause an alert to fire off. Why does this NOT work in IE6?

    Here is the code :

    Code:
    <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
    <head></head>
    <body id="home">
    	<form style="" action="" id="activities" name="activities">
    		<label for="cat_20">Health (4)</label>
    		<input id="cat_20" name="cat_20" onchange="alert('You Clicked me!');" type="checkbox">
    	</form>
    </body>
    </html>
    Last edited by justbn_me; Sep 15, 2006 at 07:01. Reason: Solved
    Justin Noel
    Better Than Broadway - The Best Local Theatre Calendar
    www.betterthanbroadway.com/

  2. #2
    SitePoint Member GreboGuru's Avatar
    Join Date
    Jun 2006
    Location
    Wensleydale, UK
    Posts
    20
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi,

    Trap the 'onClick' event instead of the 'onChange'. Works in both IE and FF.

    Hope this helps!

  3. #3
    SitePoint Member
    Join Date
    Apr 2006
    Posts
    19
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks for the response. Also, see this thread :

    http://forums.devshed.com/javascript...ml#post1612993

    Justin
    Calendee - The Calendar of Events and Entertainment
    www.calendee.com
    Justin Noel
    Better Than Broadway - The Best Local Theatre Calendar
    www.betterthanbroadway.com/


Bookmarks

Posting Permissions

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