`
mmdev
  • 浏览: 12929416 次
  • 性别: Icon_minigender_1
  • 来自: 大连
文章分类
社区版块
存档分类
最新评论

JSP中链接和按钮在页面中的传值

 
阅读更多

链接传值:<a href="hello.jsp" hello</a>

按钮传值:<input name="name" type="Button"<wbr><wbr><wbr>onclick="window.location.href='hello.jsp' " value="hello" /&gt;</wbr></wbr></wbr>

点击hello链接(或按钮)后直接跳到hello.jsp页面中去,并且把本页面中的变量goodsID传过去,在page.jsp页面中使用变量ID。

链接传值:<a href="page.jsp?ID=<%=goodsID%>"Hello</a>

按钮传值:<input name="name" type="Button"<wbr><wbr><wbr>onclick="window.location.href='page.jsp?ID=&lt;%=goodsID%&gt;' " value="Hello" /&gt;</wbr></wbr></wbr>

function addButton()
{
document.formName.action = "aa.jsp ";
document.formName.submit();
}
function modButton()
{
document.formName.action = "bb.jsp ";
return confirm( "Yes/No ");
}

<input type=submit value=add onclick= "addButton() ">
<input type=submit value=mod onclick= "return modButton() ">

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics