Jquery提交Form

22 篇文章 0 订阅
20 篇文章 1 订阅

这种提交方式和前面提到的一种,就是jquery提交方式的两种,至于用哪种,随自己的选择,最好是可以比较一下这两种方法的不同

<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>

<%@ include file="/WEB-INF/back_page/head.jsp" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<title>babasport-list</title>
<script type="text/javascript">
function getTableForm() {
return document.getElementById('tableForm');
}
function isShow(){
if(Pn.checkedCount('ids')<=0) {
alert("请至少选择一个!");
return;
}
if(!confirm("确定上架吗?")) {
return;
}
var f = getTableForm();
f.action="/product/isShow.do";
f.submit();
}

</script>
</head>
<body>
<div class="box-positon">
<div class="rpos">当前位置: 商品管理 - 列表</div>
<form class="ropt">
<input class="add" type="button" value="添加" οnclick="javascript:window.location.href='/product/toAdd.do'"/>
</form>
<div class="clear"></div>
</div>
<div class="body-box">
<form action="/product/list.do" method="post" style="padding-top:5px;">
名称: <input type="text" name="name" value="${name }"/>
<select name="brandId">
<option value="">请选择品牌</option>
<c:forEach items="${brands }" var="brand">
<option value="${brand.id }" <c:if test="${brandId==brand.id }">selected="selected"</c:if>>${brand.name }</option>
</c:forEach>
</select>
<select name="isShow">
<option value="1" <c:if test="${isShow}">selected="selected"</c:if>>上架</option>
<option value="0" <c:if test="${!isShow}">selected="selected"</c:if>>下架</option>
</select>
<input type="submit" class="query" value="查询"/>
</form>
<form method="post" id="tableForm">
<table cellspacing="1" cellpadding="0" width="100%" border="0" class="pn-ltable">
<thead class="pn-lthead">
<tr>
<th width="20"><input type="checkbox" οnclick="Pn.checkbox('ids',this.checked)"/></th>
<th>商品编号</th>
<th>商品名称</th>
<th>图片</th>
<th width="4%">新品</th>
<th width="4%">热卖</th>
<th width="4%">推荐</th>
<th width="4%">上下架</th>
<th width="12%">操作选项</th>
</tr>
</thead>
<tbody class="pn-ltbody">
<c:forEach items="${pagination.list }" var="product">
<tr bgcolor="#ffffff" οnmοuseοver="this.bgColor='#eeeeee'" οnmοuseοut="this.bgColor='#ffffff'">
<td><input type="checkbox" name="ids" value="${product.id }"/></td>
<td>${product.id }</td>
<td align="center">${product.name }</td>
<td align="center"><img width="50" height="50" src="${product.img.allUrl }"/></td>
<td align="center">是</td>
<td align="center">是</td>
<td align="center">是</td>
<c:if test="${product.isShow }"><td align="center">上架</td></c:if>
<c:if test="${!product.isShow }"><td align="center">下架</td></c:if>

<td align="center">
<a href="#" class="pn-opt">查看</a> | <a href="#" class="pn-opt">修改</a> | <a href="#" οnclick="if(!confirm('您确定删除吗?')) {return false;}" class="pn-opt">删除</a> | <a href="/sku/list.do?id=${product.id }" class="pn-opt">库存</a>
</td>
</tr>
</c:forEach>
</tbody>
</table>
<div class="page pb15">
<span class="r inb_a page_b">
<c:forEach items="${pagination.pageView }" var="page">

${page }

</c:forEach>
</span>
</div>
<div style="margin-top:15px;"><input class="del-button" type="button" value="删除" οnclick="optDelete();"/><input class="add" type="button" value="上架" οnclick="isShow();"/><input class="del-button" type="button" value="下架" οnclick="optDelete();"/></div>
</form>
</div>
</body>
</html>
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值