搞了一天了,老是报错缺少对象
<html:select property="sbph" onchange="showInfo()">//缺少对象这行报错
        <html:option value="">--选择申报批号--</html:option>
        <html:options collection="vlist" property="rsbph" labelProperty="rsbph"/>
        </html:select>
做2级的菜单子。
有经验的朋友指导下或者有例子的朋友给个参考下,实在是郁闷了。一定要使用以上标签实现。下拉框东西已经查出来了。

解决方案 »

  1.   

    onchange="showInfo()"
    你把showInfo()这个函数发出来
      

  2.   

    var XMLHttpReq;
    var FLAG;     
        function createXMLHttpRequest() {
    if(window.XMLHttpRequest) {
    XMLHttpReq = new XMLHttpRequest();
    }
    else if (window.ActiveXObject) {
    try {
    XMLHttpReq = new ActiveXObject("Msxml2.XMLHTTP");
    } catch (e) {
    try {
    XMLHttpReq = new ActiveXObject("Microsoft.XMLHTTP");
    } catch (e) {alert("创建对象失败!");}
    }
    }
    }

    function sendRequest(url) {
    createXMLHttpRequest();
    XMLHttpReq.open("post", url, true);
    //XMLHttpReq.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
    XMLHttpReq.onreadystatechange = processResponse;
    XMLHttpReq.send(null);
    }

    function processResponse() {
    if (XMLHttpReq.readyState == 4) { 
        if (XMLHttpReq.status == 200) { 
    if(FLAG ==12){
    update();
     }
    }
    }
    }
    function showInfo() {
    FLAG=12;
    var sbph=document.rkbForm.sbph.value;
    alert(sbph);
    sendRequest("../account/rkbajax.do?sbph="+sbph+"&flag="+FLAG);
    }

    function update(){
    var shuliang=XMLHttpReq.responseXML.getElementsByTagName("shuliang");
    document.form1.shuliang.value = shuliang[0].firstChild.data;
    }我的代码  帮忙看下朋友