0

hello I am trying to validate the form using jquery.. here is the code i am using but nothing is happening...

I am putthing this code in head..

<script src="jquery-2.0.3.min.js">
 $(document).ready(function () {

    $('form').validate({ // initialize the plugin
        rules: {
            fname: {
                required: true,
                email: true
            },
            lastname: {
                required: true,
                minlength: 5
            }
        },
        submitHandler: function (form) { // for demo
            alert('valid form submitted'); // for demo
            return false; // for demo
        }
    });

});

 </script>


</head>

However this code is not validating my form fields .

<form id="send" name="form" method="post" action="">

                <p>

                <label for="name">Name *</label>
                <input type="text" name="fname" value=""  />
                </p>

                <p>
                <label for="lastnamme">Father Name *</label>
                <input type="text" name="lastname"  />
                </p>
4

1 回答 1

0

你有 jquery.validate 脚本吗?我还会从脚本标签中删除 src 属性

于 2013-10-13T22:42:59.487 回答