amerikan / jquery-track-form

A smart jQuery plugin that prompts the user with a warning before leaving the page when the initial form values have changed

Home Page:http://amerikan.github.io/jquery-track-form/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

jquery-trackform.js

A jQuery plugin to track if form values have changed

Demo

Usage

In your HTML add an unique class to the form elements you would like to keep track for changes.

	<input value="hello" class="track-form" />
	<textarea class="track-form">yo!</textarea>

In your javascript initialize by selecting

$(function () {
	
	// Track any element with the given class
	$('.track-form').trackForm();

	// or you can be specific to input/textarea elements
	$('input.track-form, textarea.track-form').trackForm();
});

About

A smart jQuery plugin that prompts the user with a warning before leaving the page when the initial form values have changed

http://amerikan.github.io/jquery-track-form/

License:MIT License


Languages

Language:JavaScript 51.6%Language:HTML 48.4%