Other plugins

  • jExcel CE
    The javascript spreadsheet

Tracking the form changes

Alert the user for unsaved changes in a form before leave any page plugin.

Examples

Please consider the following form example. If the user tries to leave the page without saving, the tracking will alert for unsaved changes. If you click save, the tracker will reset and start the tracking again.




<html>
<script src="https://bossanova.uk/jsuites/v2/jsuites.js"></script>
<link rel="stylesheet" href="https://bossanova.uk/jsuites/v2/jsuites.css" type="text/css" />

<form id='myForm'>
    <div class='row'>
    <div class='column'>
    <label>Name</label>
<input type='text' name='name' value='Roger Fredson'> </div> </div> <div class='row'> <div class='column' style='padding-top:0px;'> <label>Profession</label>
<input type='text' name='profession' value='Singer'> </div> </div> <div class='row'> <div class='column' style='padding-top:0px;'> <label>Gender</label>
<select name='gender'><option value="1">Male</option><option value="2">Female</option></select> </div> </div> <div class='row'> <div class='column'> <input type='button' value='Save profile' onclick='form.resetTracker()'> </div> </div> </form> <script> var form = jSuites.tracker(document.getElementById('myForm')); </script> </html>

Methods

resetTracker();Start tracking again
isChanged();Check if the form is changed
setIgnore(status);Enable or disable the tracking