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" "季度董事会会议" }}