读书人

按钮跳转有关问题

发布时间: 2011-11-27 21:54:21 作者: rapoo

按钮跳转问题
现在有在一个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 ") ">
............

读书人网 >Java Web开发

热点推荐