<script language="javascript">//定义 下拉菜单显示的数据
var sysArray = [{id:'1',sysno:'3',sysname:'反恐精英',display:'no'},
{id:'2',sysno:'2',sysname:'星际争霸',display:'yes'},
{id:'3',sysno:'1',sysname:'由我世界',display:'yes'}];
var typeArray = [{id:'1',typeid:'C004',typename:'游戏道具问题',sysno:'1'},
id:'2',typeid:'C001',typename:'帐户问题',sysno:'1'},
{id:'3',typeid:'S002',typename:'积分问题',sysno:'2'},
{id:'4',typeid:'C003',typename:'游戏登录问题',sysno:'1'},
{id:'5',typeid:'C002',typename:'充值问题',sysno:'1'},
{id:'6',typeid:'S001',typename:'游戏操作',sysno:'2'}];
</script>
function initSelect(){ \\在也页面的onload 事件里面调用
initSysSelect();
initTypeSelect();
}
function initSysSelect(){ \\初试化第一个下拉菜单
var optionStr ="";
var sysSelectObj = document.getElementById("subSelect");
for(var i=0;i<sysArray.length;i++){
if(sysArray[i].display != "no"){
var op = new Option(sysArray[i].sysname,sysArray[i].sysno);
sysSelectObj.options.add(op);
}
}
}
function initTypeSelect(){\\根据第一个下拉菜单的值,初试化第二个菜单
var sysSelectValue = document.getElementById("subSelect").value;
var typeSelectObj = document.getElementById("typeSelect");
for(var i=0;i<typeArray.length;i++){
if(sysSelectValue == typeArray[i].sysno ){
var op = new Option(typeArray[i].typename,typeArray[i].typeid);
typeSelectObj.options.add(op); \\IE 与firefox 有有区别。这样写支持IE,firefox
}
}
}
function changTypeSelect(){//在第一个菜单的onchange事件里面调用
var sysSelectValue = document.getElementById("subSelect").value;
var typeSelectObj = document.getElementById("typeSelect");
typeSelectObj.innerHTML="";
for(var i=0;i<typeArray.length;i++){
if(sysSelectValue == typeArray[i].sysno ){
var op = new Option(typeArray[i].typename,typeArray[i].typeid);
typeSelectObj.options.add(op);
}
}
}
var sysArray = [{id:'1',sysno:'3',sysname:'反恐精英',display:'no'},
{id:'2',sysno:'2',sysname:'星际争霸',display:'yes'},
{id:'3',sysno:'1',sysname:'由我世界',display:'yes'}];
var typeArray = [{id:'1',typeid:'C004',typename:'游戏道具问题',sysno:'1'},
id:'2',typeid:'C001',typename:'帐户问题',sysno:'1'},
{id:'3',typeid:'S002',typename:'积分问题',sysno:'2'},
{id:'4',typeid:'C003',typename:'游戏登录问题',sysno:'1'},
{id:'5',typeid:'C002',typename:'充值问题',sysno:'1'},
{id:'6',typeid:'S001',typename:'游戏操作',sysno:'2'}];
</script>
function initSelect(){ \\在也页面的onload 事件里面调用
initSysSelect();
initTypeSelect();
}
function initSysSelect(){ \\初试化第一个下拉菜单
var optionStr ="";
var sysSelectObj = document.getElementById("subSelect");
for(var i=0;i<sysArray.length;i++){
if(sysArray[i].display != "no"){
var op = new Option(sysArray[i].sysname,sysArray[i].sysno);
sysSelectObj.options.add(op);
}
}
}
function initTypeSelect(){\\根据第一个下拉菜单的值,初试化第二个菜单
var sysSelectValue = document.getElementById("subSelect").value;
var typeSelectObj = document.getElementById("typeSelect");
for(var i=0;i<typeArray.length;i++){
if(sysSelectValue == typeArray[i].sysno ){
var op = new Option(typeArray[i].typename,typeArray[i].typeid);
typeSelectObj.options.add(op); \\IE 与firefox 有有区别。这样写支持IE,firefox
}
}
}
function changTypeSelect(){//在第一个菜单的onchange事件里面调用
var sysSelectValue = document.getElementById("subSelect").value;
var typeSelectObj = document.getElementById("typeSelect");
typeSelectObj.innerHTML="";
for(var i=0;i<typeArray.length;i++){
if(sysSelectValue == typeArray[i].sysno ){
var op = new Option(typeArray[i].typename,typeArray[i].typeid);
typeSelectObj.options.add(op);
}
}
}