Changing dropdown selection using Javascript

Change a dropdown selection using JavaScript.

Overview

The issue occurs when JavaScript updates the value, but the UI doesn't reflect the change.
After setting the new value with JavaScript, refresh the dropdown component to update its display.

Answered
ChronoForms v6
he healyhatman 19 Mar, 2018
I'm trying to do exactly what the title says - change the selected value of a dropdown field using javascript.

I have a custom Google Address I'm trying to sort out, trying to use the results to change the selected item in my State dropdown, but nothing works. Thanks.
Max_admin Max_admin 20 Mar, 2018
Answer
Hi healyhatman,

After changing the select field value using javascript you can try to call the following code:
$("#select_id").closest(".dropdown").dropdown("refresh");
Best regards
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
This topic is locked and no more replies can be posted.