javascript - How to set option selected when using jqtransform on select element -


How to set selected options when using jqtransform on the selected element.

I am using jqtransform for myself form, and when I am recovering the data saved from the database, I want to set the appropriate option value.

I believe you can choose the same option as without using jqTransform.

Example

  $ ('# mySelect'). Val ('myVal');   

Edit:

Well, it's really ugly but should work:

  var MySelect = $ ('# mySelect'); // Current selected option var myOption = mySelect.find ('option [value =' + mySelect.val () + ']'); // Find the indicator of that option var index = $ ('# myselect option'). Index (myOption); // click on the related jqTranfsform element mySelect.prev ('ul') trigger. Find ('Li'). Eq (index). Find ('a'). Click ();    

Comments