Skip to content

Instantly share code, notes, and snippets.

@alexanderlarson
Forked from ksolo/form-validator.js
Created October 17, 2013 20:58
Show Gist options
  • Select an option

  • Save alexanderlarson/7032108 to your computer and use it in GitHub Desktop.

Select an option

Save alexanderlarson/7032108 to your computer and use it in GitHub Desktop.

Revisions

  1. Kevin Solorio created this gist Aug 2, 2013.
    5 changes: 5 additions & 0 deletions form-validator.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,5 @@
    // shorthand for $(document).ready();
    $(function(){
    //Your code...

    });
    22 changes: 22 additions & 0 deletions index.html
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,22 @@
    <!doctype html>
    <html lang="en">
    <head>
    <meta charset="UTF-8">
    <link rel="stylesheet" href="main.css">
    <title>Form Validation</title>
    </head>
    <body>
    <form name="sign_up" action="#" method="post">
    <label for="email">Email</label>
    <input type="text" name="email" />
    <label for="password">Password</label>
    <input type="password" name="password" />

    <button type="submit">Sign Up</button>

    <ul id="errors"></ul>
    </form><body>
    <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
    <script src="form-validator.js"></script>
    </body>
    </html>
    3 changes: 3 additions & 0 deletions main.css
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,3 @@
    ul#errors {
    color: red;
    }