[jQuery] Re: Help with change event

2010-01-07 Thread NotionCommotion
Sweet!  Thanks for the help!


[jQuery] Re: Help with change event

2010-01-06 Thread NotionCommotion
Thanks John,

The last .change() fires the event.

Looking through the other documentation, it appears that the other
event methods do not need a similar trailing method to fire the event,
only change.  I've even did a test where I didn't include the last
change(), and it appeared to work.

Could you please elaborate on what by fires the event.

Thanks!


[jQuery] Re: Help with change event

2010-01-06 Thread Šime Vidas

Hehe :)
Look, event methods work like this you pass in a function, and
that function will be executed then the event occurs...

$(select).change(function() {
// code that gets executed when change event the occurs on any
SELECT element
});

But, if you leave out the argument, then the change method does
something completely different... it triggers the event... (as if you
changed the selected OPTION(s) yourself)

$(select).change();

What the guys at jQuery did in that example is, they first defined the
onchange handler, and then triggered it right away... So you got that
red Candy Caramel text on page load without having to change the
SELECT...