How to use

NPM

npm install inspect-form --save
Include the script of the Inspect on your page
<script src="./path/to/inspect.min.js"></script>
...
</body>
For more options, please access the repository

Examples

For normal implementation of the form

<form action="#" method="POST" name="formTest" novalidate>
<div class="form-group">
  <label for="name">NAME:</label>
    <input type="text" id="name" name="name" data-rules="required" data-msg-custom="Fullname">
</div>
<div class="form-group">
    <label for="email">EMAIL:</label>
        <input type="email" id="email" name="email" data-rules="required|email" data-msg-custom="Email">
</div>
<div class="form-group">
    <label for="cep" class="fl">CEP:</label>
    <input type="text" id="cep" name="cep" data-rules="cep" data-msg-custom="CEP">
</div>
<div class="form-group">
    <label for="card" class="fl">CREDIT CARD:</label>
    <input type="text" id="card" name="card" data-rules="card" data-msg-custom="CREDIT CARD" >
</div>
<div class="form-group">
    <label for="cpf" class="fl">CPF:</label>
    <input type="text" id="cpf" name="cpf" data-rules="cpf" data-msg-custom="CPF" >
</div>
<div class="form-group">
    <label for="cnpj" class="fl">CNPJ:</label>
    <input type="text" id="cnpj" name="cnpj" data-rules="cnpj" data-msg-custom="CNPJ" >
</div>
<div class="form-group">
    <label for="terms" class="fl">TERMS:</label>
    <input type="checkbox" id="terms" name="terms" data-rules="required">
</div>
<div class="form-group">
    <label for="message" class="fl">MESSAGE:</label>
    <textarea id="message" name="message" rows="10" style="width:100%;" data-rules="required|max:10" data-msg-custom="MESSAGE"></textarea>
</div>
<button type="submit">
        ENVIAR
</button>
</form>
// javaScript
new Inspect({
	'form' : 'formTest',
    'touched' : true,
    'tooltip' : true
}).toSubmit();
Format: 99999-999 or 99999999
Format: 9999 9999 9999 9999 or 9999999999999999
Format: 999.999.999-99 or 99999999999
Format: 99.999.999/9999-99 or 99999999999999

For validations and data prepared for AJAX requests

<form action="#" method="POST" name="formTest" novalidate>
<div class="form-group">
  <label for="name">NAME:</label>
    <input type="text" id="name" name="name" data-rules="required" data-msg-custom="Fullname">
</div>
<div class="form-group">
    <label for="email">EMAIL:</label>
        <input type="email" id="email" name="email" data-rules="required|email" data-msg-custom="Email">
</div>
<div class="form-group">
    <label for="subject">EMAIL:</label>
        <input type="text" id="subject" name="subject" data-rules="required" data-msg-custom="Subject">
</div>
<div class="form-group">
    <label for="message" class="fl">MESSAGE:</label>
    <textarea id="message" name="message" rows="10" style="width:100%;" data-rules="required|max:10" data-msg-custom="MESSAGE"></textarea>
</div>
<button type="submit">
        ENVIAR
</button>
</form>
// javaScript
var inspect = new Inspect({
	'form' : 'formajax',
    'touched' : true,
});	

inspect.make(function(data) {
	// your code here (for example: AJAX requests)

	// Clean the form
	inspect.pristine(); 	
});
JSON
For more options, please access the repository