Sominus

Sominus supports this item

Supported

5 comments found.

Works great, but I am not seeing the nicely formatted alert.

Its just a plain alert:

Last time you forgot to save your data, do you want to restore it? OK CANCEL

How do you style the alert?

The plugin is implemented with callback, by default the CONFIRM function is installed in it. In there appears the object of plugin that holds your data availbale and the plugin’s settings.

An example set by default:
$('input, select, textarea').DataSaver({
    dialog : function(object) {
         if (confirm(object.options.message)) {
             object.recoveryData();
         } else {
             object.clearData();
         }
    }
});

An example of a dialog box on bootstrap:

JAVASCRIPT:

$(document).ready(function() {
    $('input, select, textarea').DataSaver({
        dialog: function(object) {
            $('#recovery').modal('show');
        }
    });
    $('#restore').click(function() {
        $(document).DataSaver('recoveryData');
        $('#recovery').modal('hide');
    });
    $('#cancel').click(function() {
        $(document).DataSaver('clearData');
    });
})

HTML:

<div id="recovery" class="modal hide fade" tabindex="-1" role="dialog" aria-hidden="true">
    <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
        <h3>Recovery data</h3>
    </div>
    <div class="modal-body">
        Last time you forgot to save your data, do you want to restore unsaved data?
    </div>
    <div class="modal-footer">
        <button class="btn pull-left" data-dismiss="modal" aria-hidden="true" id="cancel">Cancel</button>
        <button class="btn pull-right btn-success" id="restore">Restore</button>
    </div>
</div> 

In the callback it is also possible to turn off a dialog box restoring right away all data without any notification of a user, e.g.

$(document).ready(function() {
    $('input, select, textarea').DataSaver({
        dialog: function() {
            $(document).DataSaver('recoveryData').DataSaver('clearData');
        }
    });
});

Hi there !

Looks great ! I am planning to build a wordpresssite with appointments + plugin. I would like to have appointment data (name, e-mail, blabla..) persistent, thus avoiding the user to re-enter it every time they visit the website.

Is your plugin a solution for my case ? Thanks.

If the user specifies the data and accidentally updated page, the plugin allows you to restore data

Thanks, Is your plugin compatible with appointment+ wordpress plugin ?

My plugin does not konfliktiruet with any other

hey there is it possible to list items stored?

hi, yes you can

Two quick questions, I’m attempting to only save certain form fields, I attempted to do this by targeting certain form fields ids (example below), but no luck. Also what way would you recommend disabling the alert dialog all together? Thanks.

$(document).ready(function() {
   $('#name, #email').DataSaver({
    //message: 'Last time you forgot to save your data...',
   });
})

hi, there is a link to see?

congratulations

ty

by
by
by
by
by
by