跳到內容
欄目
Fiesta

field-url

表單 人會打字入去嘅欄位,處於真正表格會令佢哋出現嘅狀態。每個都放喺一個有留白嘅 rst-box 入面,因為表格就係放喺呢種卡片入面。

網址欄位,example.com 帶唔帶 https:// 都得。讀表格嗰邊要自己補返協定同檢查個網址。

每個例子都真係用得,不過入面啲連結唔會帶你去邊度。 HTML 顯示可以複製嘅標記。

最簡單

預覽

將呢段放入 <section rst-box><form rst-form> 入面。

<div rst-field>
  <label rst-field-label for="fu_bare">網站</label>
  <input rst-input id="fu_bare" name="fu_bare" type="text" inputmode="url" autocomplete="url" autocapitalize="none" autocorrect="off" spellcheck="false">
</div>

帶一句提示

預覽

將呢段放入 <section rst-box><form rst-form> 入面。

<div rst-field>
  <label rst-field-label for="fu_hint">公司網站</label>
  <input rst-input id="fu_hint" name="fu_hint" type="text" inputmode="url" autocomplete="url" autocapitalize="none" autocorrect="off" spellcheck="false" aria-describedby="fu_hint-hint">
  <small rst-field-hint id="fu_hint-hint">唔使打 https。</small>
</div>

帶一個錯誤

預覽

將呢段放入 <section rst-box><form rst-form> 入面。

<div rst-field>
  <label rst-field-label for="fu_error">網站</label>
  <input rst-input id="fu_error" name="fu_error" type="text" inputmode="url" autocomplete="url" autocapitalize="none" autocorrect="off" spellcheck="false" value="brightwater" aria-invalid="true" aria-describedby="fu_error-error">
  <small rst-field-error id="fu_error-error">請輸入網址,例如 example.com。</small>
</div>