Demo of serialize() function with all types of form inputs

Name
Address
Sex Male Female
Class
Agree to terms & conditions

HTML

<table><form id=f1>
<tr><td>Name</td><td><input type=text name=t1></td></tr>
<tr><td>Address</td><td><textarea rows=3 cols=40 name=t2 id=t2></textarea></td></tr>
<tr><td>Sex</td><td>
<input type=radio name=r1 value=male>Male
<input type=radio name=r1 value=female>Female
</td></tr>

<tr><td>Class</td><td><select name=class>
 <option value=first>First</option>
<option value=second>Second</option>
<option value=third>Third</option>
</select>

</td></tr>

<tr><td><input type=checkbox value=yes name=c1></td>
<td>Agree to terms & conditions</td></tr>
<tr><td><input type="button" id="b1" value="Submit"></td>
<td></td></tr>
</form>
</table>

JQuery

<script>
   $(document).ready(function() {
      $("#b1").click(function(event){
         form_list = $("#f1").serialize();
$("#display").html(form_list);
    
});
   });
</script>


plus2net.com



Post your comments , suggestion , error , requirements etc here .







Most Popular JQuery Scripts

1

Two dependant list boxes

2

Calendar with Date Selection

3

Data change by Slider

4

Show & Hide element
We use cookies to improve your browsing experience. . Learn more
HTML MySQL PHP JavaScript ASP Photoshop Articles FORUM . Contact us
©2000-2020 plus2net.com All rights reserved worldwide Privacy Policy Disclaimer