user1721135
user1721135

Reputation: 7092

jQuery auto fill form fields from cookie

I am trying to create a jQuery script which will save form fields values in a cookie, and if the user returns to the same form the form will be autofilled.

Specifically I was wondering, how can I get the value of a form field, or anything, and save it in a cookie and then return it later on using jQuery.

I found very old plugins doing this, but those dont seem to work with recent jQuery versions, and I dont really like using plugins.

What is the propper jQuery way of dealing with cookies? Is there any?

Upvotes: 0

Views: 1902

Answers (1)

Ven
Ven

Reputation: 19040

You have the jQuery-cookie plugin : https://github.com/carhartl/jquery-cookie and jQuery's serialize() : http://api.jquery.com/serialize/

Upvotes: 1

Related Questions