問題就是說 我用javerscript做了一個即時性的二階下拉式選單\r
以下是我參考後寫的
但是送出後所連的php語法一直都沒辦法找到我選的那2個值\r
因為我想選2個值後用php能抓到資料庫去 煩請會的大大多多指導一下
小弟第一次po這種文章 若有不合規定的地方請多多見諒@@
代碼: 選擇全部
<script>
department=new Array();
department[0]=["請選擇植物名稱"];
department[1]=["雞蛋花"];
department[2]=["繡球花"];
department[3]=["香雪球"];
department[4]=["三白草"];
function renew(index){
for(var i=0;i<department[index].length;i++)
document.myForm.member.options[i]=new Option(department[index][i], department[index][i]); // 設定新選項
document.myForm.member.length=department[index].length; // 刪除多餘的選項
}
</script>
<form name="myForm" action="find.php" method="post">
科名:
<td colspan="2" bgcolor="#66FF00"><select size=5 onChange="renew(this.selectedIndex);">
<option value=0 selected>請選擇科名……</option>
<option value="1" > 夾竹桃科</option>
<option value="2" >八仙花科</option>
<option value="3" >十字花科</option>
<option value="4" >三白草科</option>
</select></td>
名稱:
<td colspan="2" bgcolor="#66FF00"><select name="member" size=5>
<option value="">請選出植物名稱\r
</select></td>
<input type="submit" name="Submit" value="送出">
</form>
<p> </p>
<hr>那是就設一個值來取得myForm跟member的資料囉?
因為在下試了很久 一直都跑不出資料來 希望看得懂的人能告知一下
