Test form validation with validate.js
How do I make an test form validation with validate.js?
What is a test form validation with validate.js? How do you make a test form validation with validate.js? This script and codes were developed by Martin Boyce on 20 September 2022, Tuesday.
Test form validation with validate.js - Script Codes HTML Codes
<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>test form validation with validate.js</title> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/normalize/5.0.0/normalize.min.css"> <link rel='stylesheet prefetch' href='http://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css'> <link rel="stylesheet" href="css/style.css">
</head>
<body> <script src="//rickharrison.github.io/validate.js/validate.js"></script>
<div class="container-fluid"> <h1>Test form validation with validate.js</h1> <form method="POST" class="unpadded selfreg" id="selfreg" name="selfreg" autocomplete="off"> <div class="errormessage" id="selfRegMessage"> </div> <fieldset> <legend>Please enter the following information: (all fields must be completed)</legend> <div class="form-group"> <label for="nfirst">Given Names:</label> <input class="form-control" name="nfirst" id="nfirst" value=""> </div> <div class="form-group"> <label for="nlast">Family Name:</label> <input class="form-control" name="nlast" id="nlast" value=""> </div> <div class="form-group email-check"> <label for="email">Do not enter anything in this field:</label> <input class="form-control" id="nEmail" type="text" name="nEmail" value="" /> </div> <div class="form-group"> <label for="street_aaddress">House no. & Street:</label> <input class="form-control" name="stre_aaddress" id="stre_aaddress" value=""> </div> <div class="form-group"> <label for="city_aaddress">Suburb State Postcode:</label> <input class="form-control" name="city_aaddress" id="city_aaddress" value=""> <span class="formLabelExample formNote">Please add 2 spaces between the city, state & postcode. eg. SUTHERLAND [space][space] NSW [space][space] 2232</span> </div> <div class="form-group"> <label for="zemailaddr">Email:</label> <input class="form-control" name="zemailaddr" id="zemailaddr" value=""> </div> <div class="formgroup"> <label for="tphone1">Phone:</label> <input class="form-control" name="tphone1" id="tphone1" value=""> <span class="formLabelExample formNote">No spaces please, eg. 95234321</span> </div> <div class="form-group"> <label for="F051birthdate">Date of Birth:</label> <input class="form-control" name="F051birthdate" id="F051birthdate" value="" > <span class="formLabelExample formNote">Enter your DOB in the format DD/MM/YYYY. eg. 29/01/1980</span> </div> <div class="warning"> <p>Important: by submitting this form you are agreeing to comply with the restrictions set out on this page and with the Libary's general <a href="https://www.sutherlandshire.nsw.gov.au/Library/Membership/Conditions_of_Membership" target="_blank">Conditions of Membership</a>.</p> <p>To confirm your membership you must visit any Sutherland Shire Library within 6 weeks, complete a printed application form and show personal identification, whereupon you will be issued a permanent library card. If you don't confirm your account your membership will be cancelled and you will need to re-join.</p> </div> <button type="submit" class="btn btn-info">Submit</button> </fieldset> </form> <div class="row"> <h2>Some footer text.</h2> </div>
</div><!-- /container --> <script src='http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js'></script> <script src="js/index.js"></script>
</body>
</html>
Test form validation with validate.js - Script Codes CSS Codes
.email-check { position: absolute; right: 110%; height: 0; overflow: hidden;
}
Test form validation with validate.js - Script Codes JS Codes
var validator = new FormValidator('selfreg', [{ name: 'nfirst', display: 'Given Names', rules: 'required' }, { name: 'nlast', display: 'Family Name', rules: 'required' }, { name: 'nEmail', display: 'do not enter', rules: 'max_length[0]' }, { name: 'stre_aadress', display: 'Street Address', rules: 'required' }, { name: 'city_aaddress', display: 'Suburb, State, Postcode', rules: 'required' }, { name: 'zemailaddr', display: 'Email address', rules: 'required|valid_email' }, { name: 'tphone1', display: 'Telephone No', rules: 'required|alpha_numeric' }, { name: 'F051birthdate', display: 'Date of Birth', rules: 'required|exact_length[10]' }], function(errors, event) { if (errors.length > 0) { // Show the errors var displayErrors = document.getElementById('selfRegMessage'); var errorString = ''; for (var i = 0; i < errors.length; i++) { errorString += errors[i].message + '<br />'; } displayErrors.innerHTML = errorString; } });
Developer | Martin Boyce |
Username | boycetrus |
Uploaded | September 20, 2022 |
Rating | 3 |
Size | 3,293 Kb |
Views | 22,264 |
Find the perfect freelance services for your business! Fiverr's mission is to change how the world works together. Fiverr connects businesses with freelancers offering digital services in 500+ categories. Find Developer!
Name | Size |
Get the app | 3,198 Kb |
Flexbox horozontal scrolling booklist | 5,605 Kb |
Homepage thumbnail | 1,852 Kb |
Booklist Using Google Spreadsheets as JSON Source and Handlebars for templating | 3,063 Kb |
Nested flexbox layout for library catalog | 3,271 Kb |
First steps with Handlebars.js | 3,978 Kb |
Test Case for ajax fail on single result | 3,297 Kb |
Google Maps API test | 4,057 Kb |
Fetching book covers with the Google Books API | 8,769 Kb |
Sutherland Shire Libraries Catalogue Search | 2,732 Kb |
Jasper is the AI Content Generator that helps you and your team break through creative blocks to create amazing, original content 10X faster. Discover all the ways the Jasper AI Content Platform can help streamline your creative workflows. Start For Free!
Name | Username | Size |
Rainbow Drops | Csbarnes | 2,365 Kb |
03 - CSS Variables | Run-time | 2,682 Kb |
Slider for stackoverflow | KKOKU | 3,222 Kb |
Scrolling Horizontal Isotope | Bramus | 2,017 Kb |
Using Flickr API | MoyArt | 6,761 Kb |
Spilled Paint | Darrylhuffman | 3,894 Kb |
Heartbeat | Apetrov | 2,079 Kb |
Svg penguin | _massimo | 2,990 Kb |
A Pen by lizz | Lizz | 10,068 Kb |
DevCamp 2014 - Denver Public Library | See8ch | 5,033 Kb |
Surf anonymously, prevent hackers from acquiring your IP address, send anonymous email, and encrypt your Internet connection. High speed, ultra secure, and easy to use. Instant setup. Hide Your IP Now!