Knowledge Walls
Venkatesan
Hyderabad, Andhra Pradesh, India
Passcode:
.serialize() in HTML Form of JQuery
2470 Views
HTML
<form id="frm_user_form" onsubmit="return false">
  Username: <input type="text" name="txt_username" /><br />
  Password: &nbsp;<input type="password" name="txt_password" /><br />
  <button>Show Json</button>
</form>
JQuery
$(function(){
   $("button").click(function(){
        alert($("#frm_user_form").serialize());
   });
});
Demo & Output 
Demo
http://www.knowledgewalls.com/realtimejqueryeditor/serialize-function-in-jquery

Output
txt_username=knowledgewalls%40gmail.com&txt_password=knowledgewalls
Next Topics
Next lessons of current book.
Jquery Exercises of JQuery
Event handler methods of JQuery
Previous Topics
Previous lessons of current book.
HTML Insertion of JQuery
HTML Insertion of JQuery
HTML Insertion of JQuery
Best Lessons of "JQuery"
Top lessons which are viewed more times.
HTML Insertion of JQuery
HTML Insertion of JQuery
HTML Insertion of JQuery
Form Validation of JQuery
HTML Insertion of JQuery
HTML Form of JQuery
HTML Insertion of JQuery
Jquery Exercises of JQuery
  Copyright © 2014 Knowledge walls, All rights reserved
KnowledgeWalls
keep your tutorials and learnings with KnowledgeWalls. Don't lose your learnings hereafter. Save and revise it whenever required.
Click here for more details