[Solved] jQuery validate function Does not work [closed]


You need to add the validation to the form element and set the required rule to the checkbox

<form id="myform">
    <input type="checkbox" value="agree" name="agree" id="agree" />
    <input type="submit">
</form>

then

jQuery(function ($) {
    $("#myform").validate({
        rules: {
            agree: {
                required: true
            }
        },
        messages: {
            agree: "Please agree the terms and conditions"
        }
    });
});

Demo: Fiddle

solved jQuery validate function Does not work [closed]