Contact Form 7
[resolved] Contact Form 7 autosave (or with save button if easier) datas into cookie (6 posts)

  1. EvilJeff
    Posted 4 years ago #

    Hi all,

    I'm using Contact Form 7 plugin and I would like to autosave input and textfield datas once entered, possibly without clicking any button.

    Is that possible? I've looked everywhere and tried various jquery plugins (http://www.howtocreate.co.uk/tutorials/jsexamples/saveForm.html)(http://rikrikrik.com/jquery/autosave/) but none of them are working.

    Any help would be very appreciated.



  2. BAC
    Posted 4 years ago #

    I would have a look at using LocalStorage rather than cookies, might be easier. All major browsers support LocalStorage.

    simple example here, which autosaves the data as the user types: http://www.thomashardy.me.uk/using-html5-localstorage-on-a-form

    Maybe look wrapping the keyUp in timeout function to add a small delay before each update.

    Test LocalStorage in chrome or safari's resources inspector.
    Hope this helps.

  3. EvilJeff
    Posted 4 years ago #

    Hi BAC,

    Thank you so much for your reply, that worked perfectly!!

    Thanks, thanks, THANKS!!


  4. ThomasHardy
    Posted 4 years ago #

    Hi Bac and Jeff,

    Glad you both found my tutorial useful, as you may of noticedin the comments it is better to use .change instead of .keyup as you then cget it if someone uses autosave or copies and pastes something in. (I know that if someone did this they probably don't need to use localStorage but it's nice to have them covered :))


  5. BAC
    Posted 4 years ago #

    @ThomasHardy, that's incredibly diligent and helpful of you to post back with that update. Thank you.

  6. alanFW
    Posted 4 years ago #

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Contact Form 7
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic