Getting Started

Installation

No matter if you are a beginner or an advanced user, starting with jn.formvalidation is easy.

Include CSS

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">

Include JS

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>

Set HTML

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>

Call the Plugin

Now call the JN Form Validation initializer function and your form validation is ready.

const jn_validation = new JnFormValidation({
    showErrorMessages: true,
    formClass: '.jnForm',
});