I am using .tmpl() to fill out templates like so
<script type="text/x-jquery-tmpl" id="template">
<form action="" method="post">
<div>
<div> ${ID} </div>
<div> <input name="title" id="${ID}_title" value="${title}" type="text" /> </div>
<label> Section (${section}) </label>
<select name="section" id="${ID}_section">
<option value="">-- Select --</option>
<option value="aaa">AAA</option>
<option value="bbb">BBB</option>
</select>
</div>
</form>
</script>
where ${section} wil contain either the combo box value aaa or bbb.
How do I set the default selection for the combo box according to ${section}?
try something like:
Update
Well my jsfiddle in comment was just a way to simulate your setup, because you don’t attached it in this post. If $section == bbb or aaa try this:
Otherwise more code is needed, how do you call your template and how is $section assigned.
Update 2
try: http://jsfiddle.net/3TrEY/6/