Skip to content

akjpro/form-anticlear

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 

Repository files navigation

form-anticlear

Version : 1.2

An Easy way to avoid loss of form contents even if we refresh the page. Developed in pure Javascript. So, not required any additional libraries like jQuery.

Usage

Include form-anticlear library in your website

<script src="https://cdn.jsdelivr.net/gh/akjpro/form-anticlear/base.js"></script>

Add class form-anticlear in form or any elements.(This will consider as the parent-element, and all its child elements will get this affected)

<form class="form-anticlear">
   <input type="text" name="myText">
</form>

Additional Options

Exclude from anticlear

Add class form-anticlear-none to the elements. This will be affected to the applied elements and its child elements.

<input type="text" class="from-anticlear-none">

Form Clear Method

formAntiClear.clear() : to clear all the form elements coming inside of form-anticlear class.

formAntiClear.clear(<Selector>) : To clear the elements with selectors (id, classname etc).

Handling Event

Able to handle anticleared event to do something after data loaded to form.

Javascript
document.addEventListener('anticleared', function (e) {
     //Statements
}, false);
jQuery
$(document).on('anticleared',function (e) {
     //Statements
})

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published