Skip to content

How to access jQuery serialized data?


How can I access the data that has been ’serialized’ using the jQuery function?

var test = $("form").serialize();

I have this data…


How can I get the value of ‘url’? - I tried this…


But I get undefined - I want to get the result as "hello+1"


The serialize method only creates a URL encoded string from a form, but this is a string, i.e you can not get the value of url or any other value. To do so you need to parse back the string into an object. You can check library out:

However it would be best if you simply select the field containing that value and get it from there, i.e.


or if you have an id or class on that field, you can use it as a selector.

P.S. The value of url is “hello 1″ the + is just how spaces are encoded in query strings.

Posted in Ajax, jquery. Tagged with , .

0 Responses

Stay in touch with the conversation, subscribe to the RSS feed for comments on this post.

You must be logged in to post a comment.