选项可以通过数据属性或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
的反馈错误默认值。
答案 0 :(得分:0)
关于this answer,您必须使用特殊的引号样式将data-feedback
- 属性写入表单标记:
<form ... data-feedback='{"success": "fa-check", "error":"fa-times"}'>
请注意引号语法。