Anatoliy
Well-known member
How do I use 'selected' attribute in XF template, like
?
throws me an error
"Template Compilation Error
public:av_notes_edit - Line 17: Syntax error - Template name: public:av_notes_edit
"
here is my form
HTML:
<option value="second" selected>Second Value</option>
HTML:
<xf:option value="normal" selected>Normal</xf:option>
"Template Compilation Error
public:av_notes_edit - Line 17: Syntax error - Template name: public:av_notes_edit
"
here is my form
Code:
<xf:title>
<xf:if is="$note.note_id">
Edit note
<xf:else />
Add new note
</xf:if>
</xf:title>
<xf:form action="{{ link('notes/save', $note) }}" class="block" ajax="1">
<div class="block-container">
<div class="block-body">
<xf:dateinputrow name="post_date" value="{$note.post_date}" label="Fishing trip date" />
<xf:selectrow name="quality" label="Quality">
<xf:option value="">--Please choose an option--</xf:option>
<xf:option value="excellent">Excellent</xf:option>
<xf:option value="good">Good</xf:option>
<xf:option value="normal" selected>Normal</xf:option>
<xf:option value="bad">Bad</xf:option>
<xf:option value="skunk">Skunk</xf:option>
</xf:selectrow>
<xf:textarearow name="content" value="{$note.content}" label="Your note" autosize="true" rows="5" />
</div>
<xf:submitrow submit="{{ phrase('save') }}" fa="fa-save" />
</div>
</xf:form>