0

I am using civem.js to customise my html5 form elements error messages and its all working fine.

However if user accidentally clicked on submit before ticking the required checkbox, the will be promoted with the assign error message which is fine. Now if user went back and checked it, the form will not submit asking them to check the box. it's like it wont kick the checkbox out of required mode onclick.

Here is a link http://jsfiddle.net/BqUNS/, please click submit before ticking the checkbox.

Any help would be appreciate it.

<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <script src="js/civem-0.0.6.min.js"></script>
    <title></title>
</head>
<body>

    <form>
        <input type="text" placeholder="First name" required data-errormessage-value-missing="Please enter your first name"> <br>
        <input type="checkbox" value="checked" value="checked" required data-errormessage="Please check"> <br>
        <button type="submit">SUBMIT</button>
    </form>

</body>
</html>
4

1 回答 1

0

似乎 civem.js 不支持复选框类型的输入。作者提到,他很快就添加了对单选按钮的支持,但 源代码中没有处理复选框

尽管从脚本中识别出该复选框(因为它正在“寻找”输入标签),但没有对更改事件做出反应的逻辑。因此它无法识别复选框的状态是否已更改

于 2013-06-24T07:15:29.257 回答