Page 1 of 1

Change selected option of a select control in javascript

Posted: Mon Apr 28, 2014 8:26 pm
by jonwrig

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?


Change selected option of a select control in javascript

Posted: Tue Apr 29, 2014 1:42 am
by Igor

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


Change selected option of a select control in javascript

Posted: Tue Apr 29, 2014 7:29 pm
by jonwrig

Worked a treat - thanks.