首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > JAVA > Java Web开发 >

按钮跳转有关问题

2011-11-27 
按钮跳转问题现在有在一个FORM中有2个按钮button1和button2现在要2个按钮都要将inputtype text name

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

热点排行