我有这个:
<input id="surname" type="text" name="surname" required pattern="alpha_numeric"/>
<span id="surname_error" class="form-error">
You need to enter a surname
</span>
如果我在其中输入一个值,然后将其删除,它将按预期显示错误。
但是,如果我登陆该字段(从选项卡或通过单击)然后选项卡或单击另一个字段,则不会显示错误。
这种行为也显示在 abide 文档页面上:
http://foundation.zurb.com/sites/docs/abide.html
检查 Abide 演示 html 块后的“需要密码”字段。如果您在没有输入值的情况下退出它。未显示相应的错误。如何更改行为,以使必填字段在失去焦点时显示相应的错误,而不管先前是否存在值?
提前致谢
迪伦