Jquery serialized form removes the specified element sample code
- 2020-03-30 02:36:23
- OfStack
<html>
<head>
</head>
<body>
<form name="form1">
<input type="hidden" name="page1" class="flau_u_ro" value="1"></input>
<input type="hidden" name="pageno" value="1"></input>
<input name="pagename" value=""></input>
<select name='pageflag'>
<option value='1' > is </option>
<option value='0' selected='selected'> no </option>
</select>
</form>
</body>
<script text="text/javascript" src="jquery-1.8.2.js"></script>
</html>
Serialization code:
$("form[name='form1']").not($("input[type='hidden']"))
.not($("input[class='flau_u_ro']")).serialize();
Chrome console to run the code, output:
"Page1 = 1 & pageno = 1 & pagename = & pageflag = 0"