<script language="javascript" type="text/javascript">
<!--
var FPathNo = [color=#FF0000]"TOPCAN-A";[/color]
function Btn_PathWP_onclick() {
window.open('../Query/PathWpQuery.aspx?FPathNo='+ FPathNo,'','width=400,height=300,left=400,top=200,scrollbars=1,status=1,resizable=1');
}// -->
</script>
如何 FPahNo能够获得前台 txtBox的值呢???

解决方案 »

  1.   

    document.getElementById('txtBox').value;
      

  2.   

    可以呀!document.getElementById("txtname").value
      

  3.   

    var FPathNo = document.getElementById('txt_FPathNo').value;
    不成功啊,传到的值为undefined
      

  4.   

    txtBox是ID吧? 不是name吧?
      

  5.   

    我写的是ID的名字,我用的c#的txtBox控件,这样有没问题的?
      

  6.   

    打开网页,右键,查看源码,看到前台后实际的ID属性..document.getElementById("实际ID").value
      

  7.   

    <input name="txt_FPathNo" type="text" value="TOPCAN-C" id="txt_FPathNo" class="InputCss" style="width:150px;" />
      

  8.   

    A界面后台:
    <script language="javascript" type="text/javascript">
    <!--
    var FPathNo = document.getElementById("txt_FPathNo").value;
    function Btn_PathWP_onclick() {
    window.open('../Query/PathWpQuery.aspx?FPathNo='+ FPathNo,'','width=400,height=300,left=400,top=200,scrollbars=1,status=1,resizable=1');
    }
    // -->
    </script>B界面接收:
    string aa = Request.Params["FPathNo"].ToString();
      

  9.   

    谢谢楼上的各位,
    var FPathNo = document.getElementById('txt_FPathNo').value; 
    是可以的,只是我变量放错地方。现在解决啦