On 2/5/11, אריה גלזר <arieh.gla...@gmail.com> wrote:
> Hey.
> I'm modifying an input's value/state through JS, and I wanted to know if
> there's a way to make it trigger the change event.

Oh, so you wanna set checked and then somewhere else subscribe to
something like CheckboxStateChanged (gecko).

> This example: http://jsfiddle.net/ariehg/4AZEL/ won't work.

You have `var bla = $('bla');` Shouldn't that be `var bla = $('#bla');` ?

> I require this behavior for radio/checkbox changes as well. Is it possible
> or do I need to create a different mechanism for this? (such as a js
> observer that will be notified when the change was done)
>
How about creating your own widget to fire a custom
checkboxStateChanged event? The event will fire in two cases: 1)
"change" events from the user and 2) when the widget's
`setChecked(cbName)`  is called. The only case it can't cover is when
some other code arbitrarily changes the checkbox so if you can design
around that, you're g2g.

HTH.
-- 
Garrett

-- 
To view archived discussions from the original JSMentors Mailman list: 
http://www.mail-archive.com/jsmentors@jsmentors.com/

To search via a non-Google archive, visit here: 
http://www.mail-archive.com/jsmentors@googlegroups.com/

To unsubscribe from this group, send email to
jsmentors+unsubscr...@googlegroups.com

Reply via email to