Using jQuery to set the selected element of the select control to be the item with the text description. Value from php.
//set js var from php var var myText = '<?php echo $myText; ?>'; //set selected using text value //$("#my-Select option[ text=" + myText + "]").attr("selected","selected") ; //set selected using value value $("#my-Select option[value=" + myText +"]").attr("selected","selected") ;
What do you think?