div及2级联动表的使用心得
2级联动表部分代码: 先将需要隐藏的内容写到以下的标签中该标签的属性写成如下格式:
<title>My JSP 'index.jsp' starting page</title>
}
function setValues1(){ var filename=document.all.filename.value;
var htmlPrintMode=document.getElementById("htmlPrintMode"); var htmlPrintType=document.getElementById("htmlPrintType"); var htmlPrintFile=document.getElementById("htmlPrintFile"); var htmlPrinterName=document.getElementById("htmlPrinterName"); var htmlbut1=document.getElementById("htmlbut1"); var htmlbut2=document.getElementById("htmlbut2"); var htmlbut3=document.getElementById("htmlbut3");
var sele0=document.forms.elements; var select0=sele0.options.value; var sele1=document.forms.elements; var select1=sele1.options.value; var sele2=document.forms.elements; var select2=sele2.options.value; var sele3=document.forms.elements; var select3=sele3.options.value;
if(select0 == 0){ htmlbut1.style.display="block" htmlbut2.style.display="none"; htmlbut3.style.display="none"; htmlPrintMode.style.display="block"; htmlPrintType.style.display="none"; htmlPrintFile.style.display="none"; htmlPrinterName.style.display="none"; htmlapp.style.display="block"; str=",-awt"; if(select1==2){ htmlbut1.style.display="block" htmlbut2.style.display="none"; htmlbut3.style.display="none"; htmlPrintMode.style.display="block"; htmlPrintType.style.display="block"; htmlPrintFile.style.display="none"; htmlPrinterName.style.display="none"; htmlapp.style.display="none"; if(select2=="pr"){ str=""; str=",-print"; }else { str=""; str=",-printSquence"; } if(select2==4){ htmlbut1.style.display="block" htmlbut2.style.display="none"; htmlbut3.style.display="none"; htmlPrintMode.style.display="block"; htmlPrintType.style.display="block"; htmlPrintFile.style.display="none"; htmlPrinterName.style.display="block"; htmlapp.style.display="none"; str=""; str=",-pcl"; } else if(select2==5){ htmlbut1.style.display="block" htmlbut2.style.display="none"; htmlbut3.style.display="none"; htmlPrintMode.style.display="block"; htmlPrintType.style.display="block"; htmlPrintFile.style.display="none"; htmlPrinterName.style.display="block"; htmlapp.style.display="none"; str=""; str=",-ps"; } } else if(select1 == 3){ htmlbut1.style.display="block" htmlbut2.style.display="none"; htmlbut3.style.display="none"; htmlPrintMode.style.display="block"; htmlPrintType.style.display="none"; htmlPrintFile.style.display="block"; htmlPrinterName.style.display="none"; htmlapp.style.display="none"; str=""; str=",-pcl,Mypcl.pcl" if(select3==8){ str=""; printerName="" str=",-pcl,Mypcl.pcl" }else if(select3==9){ str=""; str=",-ps,Myps.ps" }else if(select3==10){ str=""; str=",-txt,Mytxt.txt" }else if(select3==11){ str=""; str=",-png,Mypng.png" } } }else if(select0=="server"){ htmlbut1.style.display="none" htmlbut2.style.display="block"; htmlbut3.style.display="none"; htmlPrintMode.style.display="block"; htmlPrintType.style.display="none"; htmlPrintFile.style.display="none"; htmlPrinterName.style.display="none"; htmlapp.style.display="block"; str=args2+filename+",-awt"; if(select1==2){ htmlbut1.style.display="none" htmlbut2.style.display="block"; htmlbut3.style.display="none"; htmlPrintMode.style.display="block"; htmlPrintType.style.display="block"; htmlPrintFile.style.display="none"; htmlPrinterName.style.display="none"; htmlapp.style.display="none"; if(select2=="pr"){ str=""; str=args3+filename+",-print"; }else { str=""; str=args3+filename+",-printSquence"; } if(select2==4){ htmlbut1.style.display="none" htmlbut2.style.display="block"; htmlbut3.style.display="none"; htmlPrintMode.style.display="block"; htmlPrintType.style.display="block"; htmlPrintFile.style.display="none"; htmlPrinterName.style.display="block"; htmlapp.style.display="none"; str=""; str=args3+filename+",-pcl"; } else if(select2==5){ htmlbut1.style.display="none" htmlbut2.style.display="block"; htmlbut3.style.display="none"; htmlPrintMode.style.display="block"; htmlPrintType.style.display="block"; htmlPrintFile.style.display="none"; htmlPrinterName.style.display="block"; htmlapp.style.display="none"; str=""; str=args3+filename+",-ps"; } } else if(select1 == 3){ htmlbut1.style.display="none" htmlbut2.style.display="block"; htmlbut3.style.display="none"; htmlPrintMode.style.display="block"; htmlPrintType.style.display="none"; htmlPrintFile.style.display="block"; htmlPrinterName.style.display="none"; htmlapp.style.display="none"; str=""; str=args3+filename+",-pcl,Mypcl.pcl" if(select3==8){ str=""; printerName="" str=args3+filename+",-pcl,Mypcl.pcl" }else if(select3==9){ str=""; str=args3+filename+",-ps,Myps.ps" }else if(select3==10){ str=""; str=args3+filename+",-txt,Mytxt.txt" }else if(select3==11){ str=""; str=args3+filename+",-png,Mypng.png" } }
}else{ htmlbut1.style.display="none"; htmlbut2.style.display="none"; htmlbut3.style.display="block"; htmlPrintMode.style.display="none"; htmlPrintType.style.display="none"; htmlPrintFile.style.display="none"; htmlPrinterName.style.display="none"; htmlapp.style.display="none"; //str="AllBrowseTask,"+xml+filename+".xml"+xsl+filename+".xsl,-awt"; } } function client(){ setValues1(); printerName=document.getElementById("printName").value;
var filename=document.all.filename.value;
var printAndClose=document.getElementsByName("printAndClose"); var isPrint=document.getElementsByName("isPrint"); var antialias=document.getElementsByName("antialias"); var isEdit=document.getElementsByName("isEdit"); var percent=document.getElementById("percent").value; var tool=document.all.tool.value; var data=document.all.data.value;
if(isPrint.checked){ isPrint=",-isPrint,no"; }else{ isPrint=""; }
if(printAndClose.checked){ printAndClose=",-printAndClose,no"; }else{ printAndClose=""; }
if(antialias.checked){ antialias=",-antialias,yes"; }else{ antialias=""; }
if(isEdit.checked){
isEdit=",-editable,yes"; }else{ isEdit=""; } if(percent==""){ percent=",-percent,100"; }else if(percent<=20){ percent=",-percent,20"; }else if(percent>=500){ percent=",-percent,500"; }else{ percent=",-percent,"+percent; }
if(tool==""){ tool=""; }else if(tool=="top"){ tool=",-location,top" }else if(tool=="right"){ tool=",-location,right" }else if(tool=="left"){ tool=",-location,left" }else if(tool=="hide"){ tool=",-location,hide" }
if(data=="servlet"){ data=args4+filename; }else{ data=args5+filename+".xml"+args6+filename+".xsl"; }
if(printerName==""){ printerName=""; }else{ printerName=","+printerName; }
str=args1+data+str+printerName+isPrint+printAndClose+antialias+percent+tool+isEdit;
document.applets.TestApplet.askWiApplet(str);
str="";
document.getElementById("printName").value="";
}
function server(){ setValues1(); printerName=document.getElementById("printName").value;
var filename=document.all.filename.value;
var printAndClose=document.getElementsByName("printAndClose"); var isPrint=document.getElementsByName("isPrint"); var antialias=document.getElementsByName("antialias"); var isEdit=document.getElementsByName("isEdit"); var percent=document.getElementById("percent").value; var tool=document.all.tool.value; var data=document.all.data.value;
if(isPrint.checked){ isPrint=",-isPrint,no"; }else{ isPrint=""; }
if(printAndClose.checked){ printAndClose=",-printAndClose,no"; }else{ printAndClose=""; }
if(antialias.checked){ antialias=",-antialias,yes"; }else{ antialias=""; }
if(isEdit.checked){ isEdit=",-editable,yes"; }else{ isEdit=""; } if(percent==""){ percent=",-percent,100"; }else if(percent<=20){ percent=",-percent,20"; }else if(percent>=500){ percent=",-percent,500"; }else{ percent=",-percent,"+percent; }
if(tool==""){ tool=",-location,top"; }else if(tool=="top"){ tool=",-location,top" }else if(tool=="right"){ tool=",-location,right" }else if(tool=="left"){ tool=",-location,left" }else if(tool=="hide"){ tool=",-location,hide" }
if(data=="servlet"){ data=args4+filename; }else{ data=args5+filename+".xml"+args6+filename+".xsl"; }
if(printerName==""){ printerName=""; }else{ printerName=","+printerName; }
str=str+printerName+isPrint+printAndClose+antialias+percent+tool+isEdit;
document.applets.TestApplet.askWiApplet(str);
str="";
document.getElementById("printName").value="";
}
function setFileName(){ setValues1(); } function openWindow(){ window.open("servlet/Servlet?filename="+document.all.filename.value+"&percent="+document.all.percent.value+"&isPrint="+document.all.isPrint.checked+"&printAndClose="+document.all.printAndClose.checked+"&antialias="+document.all.antialias.checked+"&location="+document.all.tool.value+"&isEdit="+document.all.isEdit.checked); }