0

关于本文件

选项可以通过数据属性或 JavaScript 传递。对于数据属性,将选项名称附加到 data-,如 data-delay=""。

但是当我这样做时......

<input 
data-feedback-error="glyphicon-remove-circle"
type="email" pattern="\b[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[a-zA-Z]{2,}\b"
class="form-control" id="exampleInputEmail1" placeholder="Email" required/>

或者

<input 
data-feedback="error:glyphicon-remove-circle"
type="email" pattern="\b[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[a-zA-Z]{2,}\b"
class="form-control" id="exampleInputEmail1" placeholder="Email" required/>

或者

<span data-feedback-error="glyphicon-remove-circle"
  class="glyphicon form-control-feedback" aria-hidden="true"></span>

或者

<span  data-feedback="error:glyphicon-remove-circle"
 class="glyphicon form-control-feedback" aria-hidden="true"></span>

...那么它不会覆盖的反馈错误默认值glyphicon-remove

4

1 回答 1

0

关于这个答案,您必须data-feedback使用特殊的引号样式将 -attribute 写入表单标签:

<form ... data-feedback='{"success": "fa-check", "error":"fa-times"}'>

注意引号语法

于 2016-05-27T14:47:31.940 回答