日期:2014-05-16 浏览次数:20429 次
<script language="javascript"> function selectNum(n){ var s="<table>"; var num=n; for (var i=1;i<num;i++){ s+='<tr><td width="133" height="28" class="a_lefttd" style="text-align:center"><input name="g'+(i)+'" type="text" id="g'+(i)+'" style="width:120px" /></td><td width="109" class="a_lefttd" style=" text-align:center"><select name="c'+(i)+'" id="c'+(i)+'" style="width:85px; color:#999999"><option value="千足银">千足银</option> <option value="足银">足银</option> <option value="S925">S925</option><option value="其它">其它</option> </select></td><td width="81" class="a_lefttd" style="text-align:center"><select name="u'+(i)+'" id="u'+(i)+'" style="width:60px; color:#999999"> <option value="克">克</option> <option value="件">件</option></select> </td><td width="72" class="a_lefttd" style="text-align:center"><input name="n'+(i)+'" type="text" id="n'+(i)+'" size="5" /></td> <td width="82" class="a_lefttd" style="text-align:center"><input name="p'+(i)+'" type="text" id="p'+(i)+'" size="5" /></td> <td width="76" class="a_lefttd" style=" text-align:center"><input name="j'+(i)+'" type="text" id="j'+(i)+'" size="8" value='+(i)+' /></td> <td width="82" style="text-align:center; border-bottom:#CCCCCC solid 1px"><select name="l'+(i)+'" id="l'+(i)+'" style="color:#999999"> <option value="销售">销售</option> <option value="换新">换新</option> </select></td> </tr>'; } s+="</table>" document.getElementById("spotlst").innerHTML=s; } </script>
<select name="select4" onChange="selectNum(this.value)"> <option value="1">1</option> <option value="2">2</option> <option value="3">3</option> <option value="4">4</option> <option value="5">5</option> <option value="6">6</option> <option value="7">7</option> <option value="8">8</option> <option value="9">9</option> <option value="10">10</option> </select>
var num = parseInt(n) + 1; //传进来的是字符串,强制转换为整数才行