[thelist] hyperlinks on label tags?

Ryan Rushton web at ryanrushton.com
Wed Sep 27 00:05:34 CDT 2006

M. Seyon wrote:
> 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.
Thanks to Sarah, Ben and Marc for your help (and yes, Sarah, despite 
your name trickery I remember our days in the multi-colored office). 
Marc's suggestion did the trick. I agree this is not an optimal 
interface choice. It is an intermediate step in a larger interface 
redesign so I am trying to make it function at an acceptable level until 
the final rev can be pushed out.

-- Ryan

More information about the thelist mailing list