faint,这个没有头脑的seagirl又用我的ID,看来密码实在不能与她一样。
其实这个问题,我的解决办法与Tedyt不谋而合,
创建一个ChangList2函数,它的内容是动态生成的。从数据库里读出SubItem,赋予函数内的数组。供的LIST1的OnClick事件调用。
假若CangCiArray保存从数据库里取出的符合条件的SubItem;
function changeTicketPrice(thelst,ItemNo)
{
var MaxItemNum;
var PriceArray = new Array( );
var CangCiDiscount=new Array( );
<%dim i,maxNum
maxNum=ubound(CangCiArray,2)
for i=0 to maxNum
response.write "CangCiDiscount["&i&"]="& CangCiArray(1,i)/10 & ";" & chr(13)&" "
next
maxNum=ubound(TicketPriceArray,2)
for i=0 to maxNum
response.write "PriceArray["&i&"]="& TicketPriceArray(0,i) & ";" & chr(13)&" "
next
response.write "thelst.length="&maxNum+1&";" & chr(13)&" "
for i=0 to maxNum
response.write "thelst.options["&i&"].text=PriceArray["&i&"]*CangCiDiscount[ItemNo];"&chr(13)&" "
next
%>
}
你可以在生成的HTML中复制一个数组。
类似于
<script langurage=javascript>
var array[][];
<% for i=1 to n %>
array[<% =1 %>][...]='<% =arrayonasp[i] %>'
</script>
这种方法我是从清华BBS中看到的。没有试过。
不过我觉得是一种简便有效的方法。