表单校验提示

查看源码

属性参考

注册名 data-controller="form"
Targets
Values
Outlets

留空提交会在输入框下方插入 .help.is-danger 提示(Bulma 表单样式)。

表单校验助手:connect 处理 enterKeyHint=”next” 的回车跳到下一控件、按 visible value 控制提交按钮;invalid->form#notice 显示本地化的错误提示,input->form#clear 恢复,tip() 标出被改动字段,filter() 提交前禁用空字段。

<form data-controller="form">
  <input required type="email" data-label="邮箱"
         data-action="invalid->form#notice input->form#clear change->form#tip">
  <button type="submit">提交</button>
</form>