Thread

Safecracker Autosave?

March 28, 2012 1:53am

Subscribe [4]
  • #1 / Mar 28, 2012 1:53am

    Komtur's avatar

    Komtur

    15 posts

    Hello,

    How can I autosave form / channel entries made via the safecracker module?

    this doesn’t work:

    $config['autosave_interval_seconds'] = 10;

    and to autosave via a click event in JS/ jQuery fails since there are required fields.

    $('a.top').click(function(fn) {
      fn.preventDefault();
      dataString = $('#publishForm').serialize();
      $.ajax({
       type: "POST",
       url: $('#publishForm').attr('action') + '/json',
       data: dataString,
       dataType: "json",
       success: function(data) {
        if (data.success) {
          alert('successfully saved (ID: '+data.entry_id+')')
                    } else {
         var err_str = JSON.stringify(data.field_errors, null, 2);
                     alert('Saving no successfull, error '+ err_str);
         console.log(data);
        } 
       },
       error: function(jqXHR, textStatus, errorThrown) {
        alert('Error: ' + textStatus);
       }
      });
     });

    Can I anyhow disable temporarely the reuired field in safecracker to save this Entry as it is?

  • #2 / Mar 29, 2012 10:14am

    Shane Eckert's avatar

    Shane Eckert

    7174 posts

    Hello Komtur,

    Thank you for posting your question here on the ExpressionEngine forums.

    This sounds like a great idea. If you can get this to work as an Add-On that would be awesome.

    I am going to move this over to Development and Programming for you. I think the collaboration over this idea from the community of Devs there will be your best bet.

    Have a great rest of the week.

    Cheers,

  • #3 / Jun 05, 2012 8:36am

    Kees Internet's avatar

    Kees Internet

    58 posts

    any updates on this? i’d be interested.

  • #4 / Feb 08, 2013 11:44am

    Pv Ledoux's avatar

    Pv Ledoux

    95 posts

    hi there, any news about this? Did you had the chance to develop the addon?

ExpressionEngine News

#eecms, #events, #releases