forum

Home / DeveloperSection / Forums / how to set jquery combo box as selected true

how to set jquery combo box as selected true

E E Cummings 2281 20-Jun-2013
Hi Expert,

I have a jquery combo box whose selected value I am storing in a session.

After I retrieve the value from the session(which contains Json data) I want to again make the combobox to be selected for the same value, i am trying to do something like this but does not seem to work.

var myArrayVar=JSON.parse(document.getElementById("populateDT").innerHTML);
alert(myArrayVar[0].ActionMessage);
if(myArrayVar[0].ActionMesssage == "Error Message")
{
            document.getElementById("combobox").value="error";
            document.getElementById("combobox").selected=true;
 }

Any help on above is really appreciated.

Updated on 20-Jun-2013

Can you answer this question?


Answer

1 Answers

Liked By