日期:2014-05-16 浏览次数:20321 次
<select size=1 name="sd_carboncopy" id="sd_carboncopy"> <option value="">无</option> <%do while not rs.eof%> <option value="<%=rs("name")%>"><%=rs("name")%></option> <% rs.movenext loop rs.close %> </select> <input type="button" value="add" onClick="setname('td_carboncopy');"> function setname(obj) { var copy=document.getElementById("sd_carboncopy").value; var answer = document.getElementsByName("cp"); if (copy != ""){ var i = answer.length if (i > 0 ) { alert(answer[i].value); } // for (var i = answer.length-1; i >= 0; i--) { //if (copy != answer[i].value ) { document.getElementById(obj).innerHTML += "<input type='checkbox' name='cp' />" + copy ; } // else // { // alert("对不起,你选择了重复的对象!"); // } //} } }