开发者

checkboxes with jquery validity

开发者 https://www.devze.com 2023-01-10 05:49 出处:网络
There seems to be a problem in FF when you use jquery.validty.js to validate my forms. If I\'m validating a checkbox or radio btn the X image doesn\'t show up. It works in safari but I haven\'t tried

There seems to be a problem in FF when you use jquery.validty.js to validate my forms. If I'm validating a checkbox or radio btn the X image doesn't show up. It works in safari but I haven't tried IE. Has anyone had this problem?

<html>
<head>
    <title>Simple</title>
    <link type="text/css" rel="Stylesheet" href="css/jquery.validity.css" />
    <script src="http://code.jquery.com/jquery-1.4.2.min.js"></script&开发者_如何转开发gt;
    <script type="text/javascript" src="javascript/validate/jquery.validity.js"></script>
    <script type="text/javascript">
        $(function() { 
            $("form").validity(function() {
                $("#vehicles")
                    .require()
                    .match("number")
                    .range(4, 12);
                                    $("#butn").require();

                $("#dob")
                    .require()
                    .match("date")
                    .lessThanOrEqualTo(new Date());
            });
        });
    </script>
</head>
<body>
    <form method="get" action="simple.htm">
        Number of Vehicles:
        <input type="text" id="vehicles" name="vehicles" title="Vehicle Count" />
        <br /><br />
        Date of birth:
        <input type="text" id="dob" name="dob" title="Birthday" />
        <br /><br />
        <input type="radio" id="butn"/>
        <input type="submit" />
    </form>
</body>


So here the jist of it. You have to add your own functions to handle it.

$("#terms").assert($("#terms:checked").length != 0,'');

<input id='terms' type='radio' />
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号