jsp頁面傳值有哪些方式
1. 隱藏域傳值:
<form method="post" action="client_crud.jsp" >
<input type="hidden" name="id" value="<%=id %>">
2. URL傳值:
用button
a.
<input name="btnModify" type="button" onClick="self.location="client_modify.jsp?id=<%=id %>""
value="修改分銷商" />
b.把input的onClick=”modifyRegion()”
function modifyRegion() {
window.self.location = client_node_modify.jsp?id=<%=id%>";
}
3. JS方式傳值
//取得form物件提交表單
with(document.getElementById("userForm")) {
method="post";
action="user_add.jsp?command=add";
submit();
function searchItem() {
with(document.forms[0]) {
action="servlet/basedata/SearchItemServlet";
jsp頁面傳值有哪些方式
1. 隱藏域傳值:
<form method="post" action="client_crud.jsp" >
<input type="hidden" name="id" value="<%=id %>">
2. URL傳值:
用button
a.
<input name="btnModify" type="button" onClick="self.location="client_modify.jsp?id=<%=id %>""
value="修改分銷商" />
b.把input的onClick=”modifyRegion()”
function modifyRegion() {
window.self.location = client_node_modify.jsp?id=<%=id%>";
}
3. JS方式傳值
//取得form物件提交表單
with(document.getElementById("userForm")) {
method="post";
action="user_add.jsp?command=add";
submit();
}
function searchItem() {
with(document.forms[0]) {
action="servlet/basedata/SearchItemServlet";
method="post";
submit();