The problem I have is trying to have a select option pre selected when populating the options dynamically. Like this:
Code: Select all
<select name="fkStateId">
<option value=""></option>
<option tal:repeat="state States" tal:attributes="value state/Id" tal:content="state/State">
</option>
</select>
Code: Select all
<select name="fkStateId">
<option value=""></option>
<option tal:repeat="state States" tal:attributes="value state/Id; selected php: state/Id == SelectedState ? 'selected' : ''" tal:content="state/State">
</option>
</select>