搞了好几天,可变(可增减)的多个二级联动菜单问题?
如何增减菜单时,连动菜单也能起作用。
//一级菜单内容
var pri_type = [ "产品1 ", "产品2 ", "产品3 ", "其他 "];
//以下为二级菜单内容
var sec_type1 =[ "蔬菜 ", "副 食 ", "水产品 "];
var sec_type2 = [ "水 果 ", "粮食 ", "油 料 ", "其它 "];
var sec_type3 = [ "特产 ", "茶 叶 ", "其 它 "];
var sec_type4 = [ "其它 "];
下面是增减菜单功能,如何加上联动菜单功能?
<body>
<!-- 以下是代码添加记录时的代码 -->
<script language=javascript>
ii=1;
var Main_Tab = mytable;
var cur_row = null;
var cur_col = null;
var the_table=Main_Tab;
function addrow()
{
ii++;
str_sel1= ' <select name= "headtype1_ '+ii+ ' " > <option selected= "selected " value= " "> 产品1 </option> " '+
' <option value= "产品1 "> 产品1 </option> '+
' <option value= "产品2 "> 产品2 </option> '+
' <option value= "产品3 "> 产品3 </option> '+
' <option value= "其 他 "> 其 他 </option> '+
' </select> ';
str_sel2= ' <select name= "headtype2_ '+ii+ ' "> <option selected= "selected " value= " "> 蔬 菜 </option> " '+
' <option value= "副 食 "> 副 食 </option> '+
' <option value= "水产品 "> 水产品 </option> '+
' <option value= "其 他 "> 其 它 </option> '+
' </select> ';
str = document.all.mytable.outerHTML;
str = str.substring(0,str.length-16);
str += ' <tr> <td align= "center "> '+ ii + ' </td> ';
str += ' <td align= "center "> '+str_sel1+ ' </td> ';
str += ' <td align= "center "> '+str_sel2+ ' </td> ';
str += ' <td align= "center "> <input type= "text " name= "Field4 " size= "20 "> </td> ';
str += ' <td align= "center "> <input type= "text " nam