• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2026
  • Last Modified:

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
0
jimbona27
Asked:
jimbona27
  • 4
  • 3
2 Solutions
 
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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

  • 4
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now