Creating a query string automatically for all form elements
Getting ready
Create a new folder Recipe2
inside the chapter2
directory. Now create a file index.html
in the newly created directory.
How to do it...
Open the
index.html
file for editing and create a form with some HTML elements, such as textboxes, radio buttons, and check boxes.<html> <head> <title>Serializing form values</title> <style type="text/css"> ul{ border:1px solid black; list-style: none;margin:0pt;padding:0pt;float:left;font-family:Verdana,Arial, Helvetica, sans-serif;font-size:12px;width:400px;} li{ padding:10px 5px;border-bottom:1px solid black;} label{width:100px;text-align:right;margin-right:10px;float:left;} </style> </head> <body> <form> <ul> <li><label>Email:</label><input type="text" name="email"/></li> <li><label>Full Name</label><input type...