[thelist] "onchange" event on checkbox and YUI

Bill Moseley moseley at hank.org
Wed Jul 29 01:00:17 CDT 2009


On Tue, Jul 28, 2009 at 12:35 AM, Lee Kowalkowski <
lee.kowalkowski at googlemail.com> wrote:

> 2009/7/27 Bill Moseley <moseley at hank.org>:
> >
> >
> > YAHOO.util.Event.on(
> >     checkbox_element,
> >    'change',
> >     function() { sub_el.style.display = checkbox_element.checked ?
> > 'block' : 'none' }
> >  );
> >
>
> Reading between the lines, this sounds like you don't want to use
> onclick.  However, onclick will also fire in those scenarios.  The
> onclick event is device-independent on form elements and links, just
> not on other elements.


Yes, I came to my senses.  onclick works fine -- I just inspect the current
state and compare with
a previous state to detect change.



> I've been in workshops where authors don't want to use 'click' in
> their instructional content because it implies use of the mouse. I
> understand that, but feel it's reasonable to use 'click' in the
> context of a cursor gesture, keyboard users would understand.  Anyway,
> the authors decided to go with 'select', I'm still tempted to give
> their help desk a ring - "I'm selecting your links, nothings
> happening".


;)


Thanks,

-- 
Bill Moseley
moseley at hank.org



More information about the thelist mailing list