When you click on a label, the click event of the related form field should fire. Unfortunately Opera and Explorer Mac don't always do this.
Explorer Mac doesn't fire the click event on text fields and textareas, while Opera only fires the click events on radios and checkboxes.
Test page. Workaround is not included.
Reported by ppk.
Explorer Mac, Opera | Reported on 8 February 2005.
This site is no longer maintained. I’m sorry, but it’s just too much work for too little return. You can continue to browse old bug reports, though.
Search reports by browser:
2 Posted by ppk on 8 February 2005 | Permalink
Sure, but the click event fires only on radios and checkboxes.
3 Posted by Wout on 8 February 2005 | Permalink
Don't get mad at me, I'm just here to learn, but should the click events fire when you just approach the input tags?
4 Posted by Ben Lawson on 8 February 2005 | Permalink
I agree with Wout: click events should not be fired on text fields and textareas, only draw focus to the referenced field. However, clicking a label for a radio or checkbox field should trigger the click event... as well as checking and/or unchecking the associated form field. One oddity I've noticed is that although IE/Mac will trigger the click event for a checkbox, it will NOT check or uncheck the checkbox! What's the sense in that?
5 Posted by ppk on 8 February 2005 | Permalink
No. A click on the label should be treated as a click on the form field, including any event handlers.
Without this it's impossible to use labels in advanced forms where clicking on elements triggers JavaScripts.
6 Posted by Chris Hester on 10 February 2005 | Permalink
Works fine in Opera 7.54u2/WinXP for me. I get an alert when clicking on every one of the form elements, not just the radio buttons and checkboxes.
7 Posted by ppk on 10 February 2005 | Permalink
Please read carefully. Clicking on the form fields is not the issue.
8 Posted by boo on 17 August 2005 | Permalink
Win IE 5: with 3 radio inputs + their respective labels, the 2nd label will not check its input, although the onClick on the label is fired.
1 Posted by Philippe on 8 February 2005 | Permalink
Using Opera, I can click on a label, and it will select the appropriate input field, whatever that one is (radio, checkbox, input[type=text], textarea,select).