下面自己放连个文件试
---
1.php
<script>
function $(id){
return document.getElementById(id)
}
function checkalls(obj,form){
var bool=(obj.checked)?true:false
for(var i=0i<form.lengthi++){
form.all[i].selected=bool
}
}
</script>
<form action="2.php" method="post" >
<input type="checkbox" name="checkall" id="checkall" onclick="checkalls(this,$('select'))" checked>全选<br>
<select multiple name="select[]" id="select" size="15" style="width:210pxheight:250px">
<option value="1" selected>顿饭大幅度</option>
<option value="2" selected>大幅度</option>
<option value="3" selected>大幅缩</option>
<option value="4" selected>到司法所</option>
</select>
<INPUT TYPE="submit" value="提交">
</form>
---
2.php
<?
echo $select[0]
echo $select[1]
echo $select[2]
echo $select[3]
?>
o = document.getElementById("select3")for(i=0i<o.lengthi++){ if(o.options[i].selected){ alert(o.options[i].value)} }