I want to populate about 20 options in a dropdown using a Rowboat call from a custom DB table. My code is:
<select name="category">
<option value="">Select a category...</option>
[[Rowboat?
&table=`cc_neilsenCategories`
&tpl=`rowboat-formit-select2`
&limit=`0`
&sortBy=`id`
]]
</select>
My rowboat-formit-select2 chunk looks like:
<option value="[[+name]]" [[!+fi.category:FormItIsSelected=`[[+name]]`]]>[[+name]]</option>
It all works ok until a form is submitted and something somewhere on the form doesn't pass validation. The select box doesn't remember it's value, I assume it's because of +fi.category is actually looking for a field in the database due to rowboat and it's coming up blank and therefore the "selected" word isn't appearing.
Can anyone recommend a way around this or a better way to achieve the select box remembering it's value after failed form validation is submitted?