开发者

Onchange not working if changes made from JavaScript function for Combobox

开发者 https://www.devze.com 2023-03-26 19:54 出处:网络
Onchange function can\'t invoke from combobox, if the change made fromJavaScript function. Say for example I have three combobox participant, margin group, Account Code. If 开发者_如何学运维I change p

Onchange function can't invoke from combobox, if the change made from JavaScript function. Say for example I have three combobox participant, margin group, Account Code. If 开发者_如何学运维I change participant will call a function, margin group values added based on participant value. Account Code values added based on margin group. The problem rise when Margin Group changes made by JavaScript function not by user. Is there any event for this situation?

Onchange not working if changes made from JavaScript function for Combobox


Then in that case, you can to trigger the event manually. If you are using jQuery, you can use the trigger event to trigger the change event http://api.jquery.com/trigger/

Alternatively, you can define the function for onChange call backs then manually call that function. The following are some psudo code.

AccountCode.onChange
  call account_code_changed()
end

Marin Group.onChange 
  # do something else
  call account_code_changed() directly
end
0

精彩评论

暂无评论...
验证码 换一张
取 消