其实就是下拉框的联动,下面是我写的代码,应该不难看懂如何应用function addOption(Des,oValue,oText){
var oOption = document.createElement("Option");
oOption.value=oValue;
oOption.text=oText;
document.all(Des).add(oOption);
}function delOption(Des){
var j=document.all(Des).length;
while(j>0){
document.all(Des).remove(j-1);
j--;
}
}function change(parentstr,curstr){ //parentstr,curstr 父类 子类
if( document.all(parentstr).value!=""){
delOption(curstr);
str=document.all("hid_"+curstr).value ;
var ss;
ss=str.split("$");
addOption(curstr,"","--请选择--");
for(i=0;i<ss.length;i++){
tmpstr=ss[i].split("#");
if (tmpstr[1]== document.all(parentstr).value){
addOption(curstr,tmpstr[0],tmpstr[2]);
}
}
}
}
var oOption = document.createElement("Option");
oOption.value=oValue;
oOption.text=oText;
document.all(Des).add(oOption);
}function delOption(Des){
var j=document.all(Des).length;
while(j>0){
document.all(Des).remove(j-1);
j--;
}
}function change(parentstr,curstr){ //parentstr,curstr 父类 子类
if( document.all(parentstr).value!=""){
delOption(curstr);
str=document.all("hid_"+curstr).value ;
var ss;
ss=str.split("$");
addOption(curstr,"","--请选择--");
for(i=0;i<ss.length;i++){
tmpstr=ss[i].split("#");
if (tmpstr[1]== document.all(parentstr).value){
addOption(curstr,tmpstr[0],tmpstr[2]);
}
}
}
}
解决方案 »
- Flexigrid如何让其中某一些行的字体变个颜色?
- NetBeans6.7下启动Tomcat6进行调试,内存溢出
- 如何在action 之间传递对象,我这样可以吗??
- 急需JSP开发人员,有兴趣的不,高薪
- 请教applet与servlet通讯,在线等
- Http status 404错误 高手帮忙…… tomcat+struts+jsp
- 在线请教JSP中文的问题--急
- 页面包含上百个同一张图片,有什么办法让浏览器只下载一次这个图片么?
- 请推荐一本jsp教程,一定要有英文和它的译本2种语言的!
- 论坛统计在线人数
- oracle中用bolb字段存取图片,多次调用时出错?
- 难,难,难!请看SQL语句问题!!!
对了,表里面的数据是从数据库里面添加的!