silly html label for tag with an image

hi there,
this is a silly problem but here goes.

this works..

<label for="test">
test
</label>
<input type="checkbox" id="test" name="test" />

This fails

<label for="test">
<img src="x"/>
</label>
<input type="checkbox" id="test" name="test" />


are images not supported within the label for?
i need to be able to toggle a checkbox using an image incase javascript is turned off.

many thanks
jimbona27Asked:
Who is Participating?
 
basicinstinctCommented:
yet another reason why ie is inferior to firefox, my list of reasons why ie is crap grows longer every day...

anyway, this is an IE bug... it works great in firefox, just not in ie...

check this out: http://snook.ca/archives/javascript/using_images_as/
0
 
R7AFCommented:
It workes in Firefox, but not IE7 it seems. What browser are you using?
0
 
jimbona27Author Commented:
yeah i know, how can ie get to version 7 and still not notice it.

i have multipleIEs installed although im particularly referring to ie7
0
Cloud Class® Course: Ruby Fundamentals

This course will introduce you to Ruby, as well as teach you about classes, methods, variables, data structures, loops, enumerable methods, and finishing touches.

 
basicinstinctCommented:
yep, this bug is in ie7...
0
 
basicinstinctCommented:
at the link i gave you the guy has suggested a workaround
0
 
jimbona27Author Commented:
so theres no work around without javascript?
0
 
basicinstinctCommented:
you're stuck with javascript to fix it for ie...

0
 
jimbona27Author Commented:
ok thanks,
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.