![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockStart.gif)
<script language="javascript" type="text/javascript">![](https://www.cnblogs.com/Images/dot.gif)
<!--
var arrSubRelatingType = new Array(); //关联交易子类
<%
VOList relating_type = (VOList)request.getAttribute("typenameListrelating");
for(int i = 0; i < relating_type.count(); i++)
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
{
%>
arrSubRelatingType[<%=i%>] = new Array();
arrSubRelatingType[<%=i%>][0]='<%=relating_type.get(i).getString("type_id")%>';
arrSubRelatingType[<%=i%>][1]='<%=relating_type.get(i).getString("type_name")%>';
arrSubRelatingType[<%=i%>][2]='<%=relating_type.get(i).getString("group_id")%>';
<%
}
%>
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
// 增加一个名为 trim 的函数作为 String 构造函数的原型对象的一个方法
String.prototype.trim = function()
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
{
// 用正则表达式将前后空格
// 用空字符串替代。
return this.replace(/(^\s*)|(\s*$)/g, "");
}
//二级联动
function linkage(selBigID,selSmallID,tip,arrSmallClass)
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
{
var objL = document.getElementById(selBigID);
var obj = document.getElementById(selSmallID);
obj.length = 0;
if(tip.trim()=="") tip="-请选择-";
if(objL.selectedIndex == 0)
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
{
obj.options[0] = new Option(tip, "");
return;
}
var len = 0;
var bigClassId = objL.options[objL.selectedIndex].value;
var tip2 = "-无子类-";
for(var i=0; i<arrSmallClass.length; i++)
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
{
//alert(bigClassId +' --- '+ arrSmallClass[i][2]);
if(arrSmallClass[i][2] == bigClassId)
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
{
tip2 = tip;
obj.options[++len] = new Option(arrSmallClass[i][1], arrSmallClass[i][0]);
}
}
obj.options[0] = new Option(tip2, "");
}
//-->
</script>
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
============================================
<td height="35" align="right">关联交易大类别:</td>
<td height="35">
<select id="drpBig_relating_type" name="drpBig_relating_type" Onchange="javascript:linkage(this.id,'drpSmall_relating_type','',arrSubRelatingType);">
<option value="">-请选择-</option>
<exp:options name="drpBig_relating_type" list="groupnameListrelating" idfield="group_id" namefield="group_name" default="<%=this.value("val_big_relating","")%>" />
</select>
</td>
<td height="35" align="right">关联交易子类别:</td>
<td height="35">
<select id="drpSmall_relating_type" name="drpSmall_relating_type">
<option value="">-请选择-</option>
<exp:options name="drpSmall_relating_type" list="typenameListrelatingSub" idfield="type_id" namefield="type_name" default="<%=this.value("val_small_relating","")%>"/>
</select>
</td>
posted @
2007-01-18 19:02
blueKnight
Views(
791)
Comments()
Edit
收藏
举报