I have a select which is bound to some values from the server using jsViews. I have successfully managed to show the options but I want be able to track and set the select option to the value from my JavaScript object. This is my code:
<select id="albumChoice" data-link="selectedAlbum">
<option value="-">Please select</option>
{^{for albums}}
<option data-link="{value{:id} text{:name}} selected{:selectedAlbum}}"></option>
{{/for}}
</select>
The complete example code is in this fiddle: http://jsfiddle.net/4ZevT/
As you can see I have tried to use selected{:selectedAlbum} but that doesn't do anything. What must I do so that the option is automatically set when the page loads to the value from the server.