结合PHP的二级联动
时间:2010-08-19 来源:willeager
var types = new Array(<!--{echo count($group_identity)}-->);
<!--{loop $group_identity $key $val}-->
types[{$key}]=new Array({echo count($val)});
<!--{loop $val $k2 $v2}-->
types[{$key}][{$k2}]=new Option("{$v2[1]}","{$v2[0]}");
<!--{/loop}-->
<!--{/loop}--> function renew_type(gid){
var type = document.getElementById("type");
if(gid==''){
type.options.length=0;
type.options[0] = new Option('请选择用户组','');
return;
}
document.getElementById("type").options.length=0;
for (var i=0;i<types[gid].length;i++){
type.options[i]=new Option(types[gid][i].text,types[gid][i].value);
}
type.options[0].selected=true;
} var arr = new Array(); arr[0]=..;arr[3]=..;..
<!--{loop $group_identity $key $val}-->
types[{$key}]=new Array({echo count($val)});
<!--{loop $val $k2 $v2}-->
types[{$key}][{$k2}]=new Option("{$v2[1]}","{$v2[0]}");
<!--{/loop}-->
<!--{/loop}--> function renew_type(gid){
var type = document.getElementById("type");
if(gid==''){
type.options.length=0;
type.options[0] = new Option('请选择用户组','');
return;
}
document.getElementById("type").options.length=0;
for (var i=0;i<types[gid].length;i++){
type.options[i]=new Option(types[gid][i].text,types[gid][i].value);
}
type.options[0].selected=true;
} var arr = new Array(); arr[0]=..;arr[3]=..;..
相关阅读 更多 +