Skip to content
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

Append validations to existing validation #71

Open
markvantilburg opened this issue Feb 23, 2015 · 0 comments
Open

Append validations to existing validation #71

markvantilburg opened this issue Feb 23, 2015 · 0 comments

Comments

@markvantilburg
Copy link
Contributor

E.g. in the example file there it checks if the required field is set.

Taking this example file, how would the require for :requiredInput2 be added to the list of validations when validity is already configured. Would it be possible to add an 'add' command to allow adding of extra validations?

<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset=utf-8>
        <title>A simple HTML5 page layout</title>
        <link rel="stylesheet" href="jquery.validity.css" />
    </head>
    <body>
        <form action="">
            <frameset>
                <legend>The form</legend>

                <label for="requiredInput">This input is required.</label>
                <input type="text" id="requiredInput" />

                <input type="text" id="requiredInput2" />

                <input type="submit" />
            </frameset>
        </form>

        <script src="jquery-1.10.2.min.js"></script>
        <script src="jquery.validity.js"></script>
        <script>
            $("form").validity(function() {
                $("#requiredInput").require();
            });

            $("#requiredInput2").require();
        </script>
    </body>   
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant