不用写JS的吧,DW專門有一個下拉列表叫跳轉列表,在值里填寫你要跳轉的頁面,就可以了

解决方案 »

  1.   

    <form action="1.jsp" onsubmit="return check()" method="post">
    <table>
    <tr>
    <td>
    <select name="type" onchange="document.getElementsByTagName('form').action=this.value+'.jsp';">
    <option value="1">横表</option>
    <option value="2">竖表</option>
    </select>
    </td>
    </tr>
    <tr>
    <td>
    <input type="submit" value="提交">
    </td>
    </tr>
    </table>
    </form>
      

  2.   

    function check(form)
    {
        var form = document.getElementById("form");
        var type = document.getElementById("type");
        
        window.location.href = type.value + ".jsp";
        
        return false;
    }