Response.Write("<script language=javascript>yhbh=document.getElementById('<%=txtBh.ClientID %>').value; if(yhbh=='') {alert('请输入用户编号'); return;} ;window.open('sftm.aspx?yhbh='+yhbh,'收费条目','toolbar=no,status=no,menubar=no,scrollbars=yes,resizable=no,width=600,height=500'); )</script>"); ,这样写对不,应怎样改,在线等,立即给分

解决方案 »

  1.   

    yhbh  前面是不是应该加个var?
      

  2.   

    <script language=javascript>
    function P()
    {
    yhbh=document.getElementById('<%=txtBh.ClientID %>').value; 
    if(yhbh=='')
    {
    alert('请输入用户编号'); 
    return;

    window.open('sftm.aspx?yhbh='+yhbh,'收费条目','toolbar=no,status=no,menubar=no,scrollbars=yes,resizable=no,width=600,height=500');
    }
    </script>
      
    Response.Write(@"<script language=javascript>P();</script>");
      

  3.   

    加了var报运行时缺少对象的错
      

  4.   

    yhbh=document.getElementById('<%=txtBh.ClientID %>').value; 
    缺少对象的错,你检查下 <%=txtBh.ClientID %> 这个在服务器控件的ID对不对