New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add new option 'bindClassTo' #200

Closed
niceue opened this Issue Dec 9, 2015 · 0 comments

Comments

Projects
None yet
1 participant
@niceue
Copy link
Owner

niceue commented Dec 9, 2015

@param options.bindClassTo {jqSelector}
The default value is ":input"
nice-validator use $input.closest(options.bindClassTo) to bind className

Example for Bootstrap:

<form id="form1">
    <div class="form-group">
        <label for="email">Email address</label>
        <input type="email" name="email" id="email" class="form-control" placeholder="Email">
    </div>
</form>
$('#form1').validator({
    validClass: "has-succes",
    invalidClass: "has-error",
    bindClassTo: ".form-group",

    fields: {
        email: "required; email"
    }
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment