jQuery serialize() method creates a URL encoded text string by serializing the form values.
This values can be used in query string for making an AJAX request.
jQuery serialize() can act on a jQuery object for selecting individual form controls like <input>, <textarea>, and <select> etc.
Suppose, you have a following HTML:
<form action-xhr="#"> Name: <input type="text" name="name" value="John"><br> Age: <input type="text" name="age" value="30"><br> <input type="submit" name="submit" value="Submit" /> </form>
When using serialize() method as below:
var str = $( "form" ).serialize(); console.log( str );
Results: name=John&age=30
Does your phone control your mind more than you control your phone? Modern life exploits…
Did you know that the prostate continues growing throughout a man's entire life, making BPH…
Could your child's snoring be more than just a noisy night? When adenoids—the lymphoid tissue…
There are a number of steps that need to be taken in order to fit…
Cryptocurrency has transformed from a digital experiment into a global financial force in just over…
Introduction Layoffs have always been a part of corporate life, but the way they’re happening…