function tijiao1()
     {
         var str3 = parseInt(document.getElementById("<%=this.DropDownList5.ClientID%>").value);
         if(str3!="")
         {
           
            if(document.getElementById("<%=this.RadioButton10.ClientID%>").checked)
             {
                 parent.bottomFrame.location='baobiao/baobiao12.aspx';
             }
              if(document.getElementById("<%=this.RadioButton12.ClientID%>").checked)
             {
                 parent.bottomFrame.location='baobiao/baobiao13.aspx';
             }
         }
         else
         {
            alert('对不起,您输入的查询条件不能为空!');
         }
     }
现在 STR3里有没有值 都直接走!else里没有起作用 这个是因为什么呀

解决方案 »

  1.   

    function tijiao1() 
        { 
            var str3 = parseInt(document.getElementById(" <%=this.DropDownList5.ClientID%>").value); 
            alert(str3);//打印出结果看看便知!
            if(str3!="") 
            { 
              
                if(document.getElementById(" <%=this.RadioButton10.ClientID%>").checked) 
                { 
                    parent.bottomFrame.location='baobiao/baobiao12.aspx'; 
                } 
                  if(document.getElementById(" <%=this.RadioButton12.ClientID%>").checked) 
                { 
                    parent.bottomFrame.location='baobiao/baobiao13.aspx'; 
                } 
            } 
            else 
            { 
                alert('对不起,您输入的查询条件不能为空!'); 
            } 
        } 
      

  2.   

    [code=HTML]function tijiao1() 
        { 
            var str3 = parseInt(document.getElementById(" <%=this.DropDownList5.ClientID%>").value); 
            alert(str3);//打印出结果看看便知!
            if(str3!="") 
            { 
              
                if(document.getElementById(" <%=this.RadioButton10.ClientID%>").checked) 
                { 
                    parent.bottomFrame.location='baobiao/baobiao12.aspx'; 
                } 
                  if(document.getElementById(" <%=this.RadioButton12.ClientID%>").checked) 
                { 
                    parent.bottomFrame.location='baobiao/baobiao13.aspx'; 
                } 
            } 
            else 
            { 
                alert('对不起,您输入的查询条件不能为空!'); 
            } 
        } [/code]
      

  3.   

    弹出的是NaN  什么意思?
      

  4.   

    请问你为什么每个getElementById函数的参数前面都要加一个空格呢?
      

  5.   

    http://www.w3school.com.cn/tiy/t.asp?f=jseg_NaN
      

  6.   

    var str3 = parseInt(document.getElementById(" <%=this.DropDownList5.ClientID%>").value);
    中间有空格,无法转换成Int