当前位置: 代码迷 >> Java Web开发 >> 按钮跳转有关问题
  详细解决方案

按钮跳转有关问题

热度:58   发布时间:2016-04-17 15:04:50.0
按钮跳转问题
现在有在一个FORM中有2个按钮   button1和button2     现在要2个按钮都要将
<input   type= "text "   name= "orderno "   /> 中得值提交……
但是button1会跳转到1.jsp页面   button2会跳转到2.jsp页面应该怎么写。。。

------解决方案--------------------
.........
<script>
function goto(url,input){

document.location=url+ ".jsp?orderno= "+input.value;
}
</script>
..
<input type= "text " id= "orderno " />
<input type= "button " value= "button1 " onclick= "goto( "1 ", "orderno ") ">
<input type= "button " value= "button2 " onclick= "goto( "2 ", "orderno ") ">
............
  相关解决方案