当前位置: 编程技术>java/j2ee
jsp dwr级联效果代码
来源: 互联网 发布时间:2014-10-16
本文导语: dwr.jsp function changeQx(p) { var val = p.value; //alert(val); JUserChec.jiLian(val, haschange); } function haschange(changeVal) { //alert(changeVal); var jd = document.getElementById("jd"); var op = new Option(changeVal, changeVal); jd.options.length=0; jd.options.add(op); } a b c dw...
dwr.jsp
function changeQx(p)
{
var val = p.value;
//alert(val);
JUserChec.jiLian(val, haschange);
}
function haschange(changeVal)
{
//alert(changeVal);
var jd = document.getElementById("jd");
var op = new Option(changeVal, changeVal);
jd.options.length=0;
jd.options.add(op);
}
a
b
c
dwr.xml
UserManager.java
package com.struts;
public class UserManager {
public boolean ccc(String uname){
if("abc".equals(uname)){
return true;
}
return false;
}
public String jiLian(String qx){
if("a".equals(qx)){
return "a1#a2#a3";
}
if("b".equals(qx)){
return "b1#b2#b3";
}
return "c1#c2";
}
}
function changeQx(p)
{
var val = p.value;
//alert(val);
JUserChec.jiLian(val, haschange);
}
function haschange(changeVal)
{
//alert(changeVal);
var jd = document.getElementById("jd");
var op = new Option(changeVal, changeVal);
jd.options.length=0;
jd.options.add(op);
}
a
b
c
dwr.xml
UserManager.java
package com.struts;
public class UserManager {
public boolean ccc(String uname){
if("abc".equals(uname)){
return true;
}
return false;
}
public String jiLian(String qx){
if("a".equals(qx)){
return "a1#a2#a3";
}
if("b".equals(qx)){
return "b1#b2#b3";
}
return "c1#c2";
}
}