Buy Now
Sign in

Changing dropdown selection using Javascript

healyhatman , March 19 2018
healyhatman 5.1
March 19 2018 #376194
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.
Web developer at SkySpider.com.au
I don't work for ChronoEngine but I do accept donations paypal.me/healyhatman

You can now copy+paste code from forums
admin 26.0
March 20 2018 #376226
 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
If your main question got answered then please mark the answer using the button!
Please let us know if you have any problems with the new forums text editor, we appreciate your feedback!
healyhatman 5.1
March 20 2018 #376229
1
That did it, thanks.
Web developer at SkySpider.com.au
I don't work for ChronoEngine but I do accept donations paypal.me/healyhatman

You can now copy+paste code from forums