WordPress.org

Ready to get started?Download WordPress

Forums

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

  1. EvilJeff
    Member
    Posted 2 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.

    Regards,
    Jeff

    http://wordpress.org/extend/plugins/contact-form-7/

  2. BAC
    Member
    Posted 2 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
    Member
    Posted 2 years ago #

    Hi BAC,

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

    Thanks, thanks, THANKS!!

    J

  4. ThomasHardy
    Member
    Posted 1 year 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 :))

    Thanks
    Thomas

  5. BAC
    Member
    Posted 1 year ago #

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

  6. alanFW
    Member
    Posted 1 year ago #

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic