about 9 years ago
We can use the serialize() method to get the data of a form. This method creates a text string in URL-encoded notation by serializing form values. It helps to select more than one element of the form.
Syntax:
$(selector).serilaize();
Example:
<html> <head> <script src="http://code.jquery.com/jquery-1.11.3.min.js"></script> <script> $(document).ready(function(){ $(document).on('submit', '#regForm', function(e) { e.preventDefault(); $(this).serialize(); alert( $(this).serialize()); }); }); </script> </head> <body> <form id="regForm" method="post" > <table align="center"> <tr><td>Registration Form</td></tr> <tr><td>Name</td><td><input type="text" id="name" name="name"></td></tr> <tr><td>Password</td><td><input type="text" id="password" name="pass"></td></tr> <tr><td>Email</td><td><input type="text" id="email" name="email"></td></tr> <tr><td><input type="submit" id="submit" value="register" align="middle"></td></tr> </table> </form> </body> </html>
Starting with Chrome version 45, NPAPI is no longer supported for Google Chrome. For more information, see Chrome and NPAPI (blog.chromium.org).
Firefox and Microsoft Internet Explorer are recommended browsers for websites using java applets.
Chrome Version Support
Are you sure, you want to delete this comment?
Sign up using
0 Comment(s)