【发布时间】:2017-10-06 15:48:41
【问题描述】:
正在处理获取输入(复选框)以在自定义消息无效(未选中)时显示自定义消息,但在此之后,如果用户选中该框,则消息仍会显示并被视为无效。我认为这与 oninvalid 但不确定。
输入代码
<input style="width:15px; height:15px; cursor: pointer;" class="form-check-input" type="checkbox" onclick="setCustomValidity('')" oninvalid="this.setCustomValidity('Please review the legal agreement and check this box to proceed')" required>
我首先收到错误消息,然后选中复选框后得到的图片
【问题讨论】:
-
setCustomValidity代码在哪里? -
@GibralterTop
setCustomValidity方法只是将消息分配为无效,documentation
标签: html angularjs twitter-bootstrap-3