[thelist] hyperlinks on label tags?

M. Seyon evolt07 at delime.com
Tue Sep 26 11:17:17 CDT 2006

Message from Ryan Rushton (9/25/2006 04:50 PM)

>I have a page that displays a list of categories with a checkbox + label
>for each category and an onChange action on each checkbox.
>The labels of categories that contain sub-categories are hyperlinked.
>When a user clicks the hyperlink to drill into the category, the
>checkbox is also getting checked/un-checked causing undesirable results.
>Is there a way to use javascript to prevent the box from being
>checked/unchecked when the label is/contains a hyperlink?

This sounds like a poor interface design decision in the first place, but 
can't you simply omit the 'for' attribute on the label tag for those labels 
that are hyperlinks?

That way the label isn't linked to the checkbox so clicking it will not 
affect the checkbox state.

The downside though is that users may not understand why checkbox state 
changes when some labels are clicked but not others.


More information about the thelist mailing list