I'm facing a situation with a website with only user accesss. I have a lot of entries to do, and I'm trying to do a script to help me in this task.
The input I want to change :
<select name="vehicleVo[year]" id="vehicleVo_year">
<option value="" selected="selected">Année</option>
<option value="2019">2019</option>
<option value="2020">2020</option>
<option value="2021">2021</option>
</select>
The Tampermonkey script change the value :
$("#vehicleVo_year").val("2019");
And when selected, the next select menu on the website should update and display stuff linked to the results (in our case: 2019). If I select manually the year 2019, everythings works fine. When I'm using the script, the select menu is showing 2019, but the next menu doesn't update.
Here what I tried already, without errors, but without any change either :
$("#vehicleVo_year").trigger("click");
$("#vehicleVo_year").change();
$("#vehicleVo_year").accordion("refresh");
I'm not sure where the problem come from, any help would be appreciated...
This wasn't a front-end issue, and the val() + change() was good option.
The next select menu I tried to refresh was triggered by an EventListener calling an ajax request to update with the previous field the user filled.
I managed to do a workaround by re-doing the same ajax call but under my control. Everything works now :)