field
標籤、輸入框、可選提示、說明同錯誤。一般嘅文字類控件,有明確 ID。
最簡單
將呢段放入 <section rst-box><form rst-form> 入面。
<div rst-field >
<label rst-field-label for ="f_bare" >標題</label >
<input rst-input type ="text" id ="f_bare" name ="f_bare" >
</div >
將呢段放入 <section rst-box><form rst-form> 入面。
{{ template "field" dict "ID" "f_bare" "Name" "f_bare" "Label" "標題" }}
帶一句提示
將呢段放入 <section rst-box><form rst-form> 入面。
<div rst-field >
<label rst-field-label for ="f_hint" >網址代號 <span rst-field-hint >(細楷,唔好有空格)</span ></label >
<input rst-input type ="text" id ="f_hint" name ="f_hint" >
</div >
將呢段放入 <section rst-box><form rst-form> 入面。
{{ template "field" dict
"ID" "f_hint"
"Name" "f_hint"
"Label" "網址代號"
"Hint" "細楷,唔好有空格" }}
控制項下面有一行說明
將呢段放入 <section rst-box><form rst-form> 入面。
<div rst-field >
<label rst-field-label for ="f_help" >電郵</label >
<input rst-input type ="email" id ="f_help" name ="f_help" autocomplete ="email" aria-describedby ="f_help-help" >
<p rst-field-help id ="f_help-help" >我哋只會用佢嚟寄回覆俾你。</p >
</div >
將呢段放入 <section rst-box><form rst-form> 入面。
{{ template "field" dict
"ID" "f_help"
"Name" "f_help"
"Label" "電郵"
"Type" "email"
"Help" "我哋只會用佢嚟寄回覆俾你。"
"Autocomplete" "email" }}
必填
將呢段放入 <section rst-box><form rst-form> 入面。
<div rst-field >
<label rst-field-label for ="f_required" >全名</label >
<input rst-input type ="text" id ="f_required" name ="f_required" required >
</div >
將呢段放入 <section rst-box><form rst-form> 入面。
{{ template "field" dict
"ID" "f_required"
"Name" "f_required"
"Label" "全名"
"Required" true }}
帶一個錯誤
將呢段放入 <section rst-box><form rst-form> 入面。
<div rst-field >
<label rst-field-label for ="f_error" >電郵</label >
<input rst-input type ="email" id ="f_error" name ="f_error" value ="grace@" aria-invalid ="true" aria-describedby ="f_error-error" >
<p rst-field-error id ="f_error-error" role ="alert" >呢個唔似係電郵地址。</p >
</div >
將呢段放入 <section rst-box><form rst-form> 入面。
{{ template "field" dict
"ID" "f_error"
"Name" "f_error"
"Label" "電郵"
"Type" "email"
"Error" "呢個唔似係電郵地址。"
"Value" "grace@" }}
窄
將呢段放入 <section rst-box><form rst-form> 入面。
<div rst-field >
<label rst-field-label for ="f_short" >郵遞區號</label >
<input rst-input ="short" type ="text" id ="f_short" name ="f_short" value ="D02 XY45" >
</div >
將呢段放入 <section rst-box><form rst-form> 入面。
{{ template "field" dict
"ID" "f_short"
"Name" "f_short"
"Label" "郵遞區號"
"Short" true
"Value" "D02 XY45" }}
主要欄位
將呢段放入 <section rst-box><form rst-form> 入面。
<div rst-field >
<label rst-field-label for ="f_primary" >標題</label >
<input rst-input ="primary" type ="text" id ="f_primary" name ="f_primary" value ="季度董事會會議" >
</div >
將呢段放入 <section rst-box><form rst-form> 入面。
{{ template "field" dict
"ID" "f_primary"
"Name" "f_primary"
"Label" "標題"
"Primary" true
"Value" "季度董事會會議" }}