All,
I'm using the Chosen plugin (
http://harvesthq.github.com/chosen/). It says that I can use the following for any change events:
Form Field Change
When working with form fields, you often want to perform some behavior after a value has been selected or deselected. Whenever a user selects a field in Chosen, it triggers a "change" event* on the original form field. That let's you do something like this:
Code:
$("#form_field").chosen().change( … );
Note: Prototype doesn't offer support for triggering standard browser events. Event.simulate is required to trigger the change event when using the Prototype version.
However, when I do this in my code and try and do something like this:
Code:
$("#form_field").chosen().change( alert("this is an alert"); );
Or Something like this:
Code:
$("#form_field").chosen().change({ alert("this is an alert"); });
It never gives me an alert and actually makes the rest of my jQuery not work. Can anyone figure out how to use this change feature? Any advice is appreciated!
Thanks!