Change selected option of a select control in javascript
Im trying to change the selected text of a select control to a value held in a local storage variable. I can't find any examples that work please help?
Catch up wih the Appery.io community on our forum. Here you'll find information on the lastest questions and issues Appery.io developers are discussing.
https://forum.appery.io/
Im trying to change the selected text of a select control to a value held in a local storage variable. I can't find any examples that work please help?
Hello,
Please try this code:
pre
//Getting select value from LSV.
var selectValue = localStorage.getItem("yourSelectValueLSV");
//Select received value into the select component. Please be sure your value is correct for this select.
Appery("mobileselectmenu_16").val(selectValue);
Appery("mobileselectmenu_16").selectmenu("refresh", true);
/pre
Worked a treat - thanks.