js传值
我想获取每个option的value值,比如:toupiaocontent1、toupiaocontent2。。。再把获得的value值传到另一php中进行处理,应该要如何操作?
<script language="javascript">
function showselectvalue(){
var svalue=document.getElementById("selectform").value;
var board=document.getElementById("board");
var board2=document.getElementById("board2");
board.innerHTML="";
for(var i=0;i<svalue;i++){
var p=i+1;
var br=document.createElement("br");
var toupiaocontent = document.createTextNode("投票项"+p+" ");
var objt = document.createElement("input");
objt.type = "text";
//objt.id = "toupiaocontent" + p;
//objt.name = "toupiaocontent" + p;
objt.id = "toupiaocontent"+p;
objt.name = "toupiaocontent"+p ;
var objtext = board.appendChild(toupiaocontent);
var obj = board.appendChild(objt);
var objbr=board.appendChild(br);
//objtext.checked= true;
//obj.checked = true;
}
}
</script>
<select name="selectform" id="selectform" onChange="showselectvalue()">
<option value="" selected></option>
<script>
for (var i = 1; i < 21; i++)
{
document.writeln("<option value ="+i+">" + i + "</option>")
}
</script>
</select>
javascript
php
传值
select
-----