<!DOCTYPE html>
<html>
<head>
<script src="/jquery/jquery-1.11.1.min.js"></script>
</head>
<body>
<form id="f">
<div class='page'>
<h3>
1--qweqwe<br /><em></em>
</h3>
<p>
<p>
<input id='vq-1' name='vnm-1' value='wqeqweqwe' type='radio' />
<label for='s'>wqeqweqwe</label>
</p>
<p>
<input id='vq-1' name='vnm-1' value='qweqwe' type='radio' />
<label for='s'>qweqwe</label>
</p>
<p>
<input id='vq-1' name='vnm-1' value='qweqwe' type='radio' />
<label for='s'>qweqwe</label>
</p>
<p>
<input id='vq-1' name='vnm-1' value='qweqwe' type='radio' />
<label for='s'>qweqwe</label>
</p>
<p>
<div class='btn_nav'>
<input type='button' class='next right' value='下一步»' //>
</div>
</div>
<div class='page'>
<h3>
2--sadsadasd<br /><em></em>
</h3>
<p>
<p>
<input id='vq-2' name='vnm-2' value='sadsad' type='checkbox' />
<label for='s'>sadsad</label>
</p>
<p>
<input id='vq-2' name='vnm-2' value='2323' type='checkbox' />
<label for='s'>2323</label>
</p>
<p>
<input id='vq-2' name='vnm-2' value='sadsad' type='checkbox' />
<label for='s'>sadsad</label>
</p>
</p>
<div class='btn_nav'>
<input type='button' class='prev' style='float: left' value='«上一步' />
<input type='button' class='next right' value='下一步»' />
</div>
</div>
</form>
<script>function g(){
var a={};
$('#f input[type=checkbox],#f input[type=radio]').each(function(){
var t=a[this.name];
if(!t)a[this.name]=t=[];
t[t.length]=this.checked?1:0;
});
var d=[];
for(var i in a){
d[d.length]=i+'='+(a[i]||[]).join('')
}
alert(d.join('&'));
}</script>
<input value="GET" type="button" onclick="g()"/>
</body>
</html>
上一页 [1] [2]