No matter if you are a beginner or an advanced user, starting with jn.formvalidation is easy.
First, include following CSS file into your HTML head:
<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/chauhan07/jn-formvalidation/code/assets/css/jn-formvalidation.min.css">
First, include following JS file into your HTML:
<script src="https://cdn.jsdelivr.net/gh/chauhan07/jn-formvalidation/code/assets/js/jn.formvalidation.min.js"></script>
You don't need any special markup
<form action="" class="jnForm">
<label class="jn-input-wrap">
<input type="text" name="" placeholder="Enter your name">
</label>
<label class="jn-input-wrap">
<input type="email" name="" placeholder="Enter your email">
</label>
<label class="jn-input-wrap">
<input type="tel" name="" placeholder="Enter your phone number">
</label>
<label class="jn-input-wrap">
<textarea name="" placeholder="Enter you message"></textarea>
</label>
<label class="jn-input-wrap">
<input type="submit" value="Submit">
</label>
</form>
Now call the JN Form Validation initializer function and your form validation is ready.
const jn_validation = new JnFormValidation({
showErrorMessages: true,
formClass: '.jnForm',
});