Loading Please Wait...
With jQuery you can encodes a set of form elements as a string or as an array of names and values for submission.
The serialize() method creates a URL encoded text string by serializing form values.
You can select one or more form elements (like input and/or text area), or the form element itself.
The serialized values can be used in the URL query string when making an AJAX request.
$(selector).serialize()
The following example output the result of serialized form values:
$("button").click(function(){
$("div").text($("form").serialize());
});
The serializeArray() method creates an array of objects (name and value) by serializing form values.
You can select one or more form elements (like input and/or text area), or the form element itself.
$(selector).serializeArray()
The following example output the result of form values serialized as arrays:
$("button").click(function(){
var x = $("form").serializeArray();
$.each(x, function(i, field){
$("#results").append(field.name + ":" + field.value + " ");
});
});
How you feel about this blog:
Share this blog on:
If you find any error in the turtorials, or want to share your suggestion/feedback, feel free to send us email at: info@lynxsia.com
Contact UsWe are concern with various development process like website design & development, E-commerce development, Software development, Application development, SMS & Bulk SMS Provider, PWA Development, and many more..
Copyright ©
, Lynxsia IT Solutions, All rights reserved