<div id="search">
<select name="page">
<option>
按新闻搜索
</option>
<option>
按产品搜索
</option>
</select>
<input type="text" width="20" heigth="20" name="find" class="search" />
<input type="submit"  class="submit" value="搜索" onclick="'index.getForward();'"/>
</div>
我点击搜索,想跳转到一个新的页面,向超链接那样!那么在我的getForward();方法里面该怎么写

解决方案 »

  1.   

    window.location="one.jsp";
    document.location="one.jsp";
      

  2.   

    那我现在要想获得“按新闻搜索”或者“按产品搜索”
    还有就是要获得我输入框text的值,但是老是获得不了
       var page = document.all("page").option[0].text.value; //获得按新闻搜索
        var str = document.all("find").value; //获得输入框的值
    但是这样写错了嘛?? 老是报错,
    执行到page那里就报不执行此对象或属性,
    执行到str也获得不了值!!
      

  3.   

    document.getElementById("find").value;
    这是最基本的,怎么连这都不会?
      

  4.   

    这个我写了 但是获得不了,我现在是要获得<option> 里面的值
      

  5.   

     
    <select id="page"> 
    <option value="0"> 
    按新闻搜索 
    </option value="1"> 
    <option> 
    按产品搜索 
    </option> 
    </select> 这样你用document.getElementById("page").value就能取到select值了
      

  6.   

    document.getElementById("page").options[1].text
      

  7.   

    var str = document.all("find")[0].value; //获得输入框的值