Hello everyone, I`m using dependent dropdown Gc librarie exaclty as example of the librarie does, and it`s working fine. But when I was tryng to make a jquery to change the current value of the select, it doesen`t work.
About structure: I have a main select that contains categories, and when I select one category another sub select opens with the respective subcategories. Until here it`s fine.
About the problems: I would like to start my select in the first position, so i did a jquery like this:
Obs.: select name: 'field-Cat_Codigo'
$(document).ready(function(){
$("#field-Cat_Codigo").val(1);
});
But it doesen't work. It works fine to normal dropdowns, but not for dependent ones. So I tried a lot of things like this in differents order of trials as:
$("#field-Cat_Codigo").trigger("liszt:updated");
$("#field-Cat_Codigo").val(1).trigger('change');
$("#field-Cat_Codigo").val(1).change();
$("#field-Cat_Codigo").change();
In other application i did it, but when I need to change the sub dropdown I got the same error. So the thing is, How can I change both selects using jquery ?
Any idea?