获取username的值,拼到url后面
 URL="/devno_select/b.php?username="+uname;在你的b.php中根据参数展示不就可以?

解决方案 »

  1.   

    问题再进一步描述下:
    a页面有:
    JS1:
    $(function(){ 
     $('#username').blur(function(){
    var parm =encodeURIComponent($("#username").val());
    $.post("php.php",{username:parm},function(data,textStatus){
    document.getElementById('userDep').value=data;
            },"text");
        });
    });JS2:
    function LoadWindow2(){
      URL="/devno_select/b.php";
      loc_x=document.body.scrollLeft+event.clientX-event.offsetX-100;
      loc_y=document.body.scrollTop+event.clientY-event.offsetY+170;
      window.showModalDialog(URL,self,"edge:raised;scroll:0;status:0;help:0;resizable:1;dialogWidth:320px;dialogHeight:445px;dialogTop:"+loc_y+"px;dialogLeft:"+loc_x+"px");
    }文本框1:
    <input type="text" name="username" id="username">
    文本框2:
    <input type="text" name="userDep" id="userDep">
    文本框3:  
    <input type="text" name="DeviceNum" id="DeviceNum" value="<?=$DeviceNum?>">
            
    按钮1:
    <input type="button" value="选 择" onClick="LoadWindow2()" title="选择编号" name="button">已经实现的效果:在文本框1输入姓名以后,会查询数据库并把部门值返回到文本框2里面。
    现在想实现的效果是:在文本框1输入姓名以后,文本框2自动带出部门(已实现),点击选择按钮,弹出窗口型b页面,b页面需显示的是根据文本框1传过来的值查询数据库后得到该人的设备编号列表请问该如何操作呢?
      

  2.   

    你可以在 b.php 中 通过
    window.dialogArguments.document.getElementById("username").value
    取值也可以
    URL="/devno_select/b.php?username=" + document.getElementById("username").value;
    window.showModalDialog(URL,self .....
    通过 url 参数传值
      

  3.   

    版主威武,解决问题哦。但还有一个小问题。
    b页面是这样的:
    <html>
    <head>
    <title>选择编号</title>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
    </head>
    <frameset cols="*"  rows="40,*" frameborder="YES" border="1" framespacing="0" id="bottom">
      <frame name="query" src="query.php" scrolling="NO" frameborder="YES">
      <frame name="devno_info" src="devno_info.php" frameborder="NO">
     </frameset><noframes></noframes>
    </frameset>
    </html>需要的效果是:
    等于要在下面半截现在返回值。