We help IT Professionals succeed at work.

how to

dgrafx
dgrafx asked
on
Medium Priority
173 Views
Last Modified: 2012-05-12
I have a selectbox where each option has an attribute "val" and on the selects change event I grab the value of the "val" attr and set the value of another element (a textbox) with that.
<option value="1" val="x2">One
<option value="2" val="z6">Two
so onchange then a textboxs value will = z6 if option Two is selected
problem:
i've incorporated a lookup box for the selectbox - when i type then a match is selected
but that of course doesnt trigger the jquery change function for the selectbox
how should i go about this?
how can i trigger the change function?

thanks
Comment
Watch Question

I believe that you can manually trigger the change event using this
http://api.jquery.com/change/
CERTIFIED EXPERT

Author

Commented:
what line at that link are you referring to?
I was meaning the .change() event in general.
Based on the examples given I think that you can just go $(ElementSelector).change() and it is supposed the trigger any change functions that you have written.
CERTIFIED EXPERT

Author

Commented:
Ahhh - ok
didn't know what you meant
yes - that works - thanks

Explore More ContentExplore courses, solutions, and other research materials related to this topic.