下载 jquery-form-3.51.0.js 开发包
在页面引入
jquery-form-3.51.0.js的用法就是可以发送异步的ajaxForm请求
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<%@ include file="/include/taglibs.jspf"%>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>绿魔方管理平台</title>
<link rel="stylesheet"
href="${ctx}/resources/libs/bootstrap-3.3.5-dist/css/bootstrap.min.css">
<link rel="stylesheet" href="${ctx}/resources/libs/css/normalize.css">
<link rel="stylesheet" href="${ctx}/resources/libs/css/cssresets.css">
<link rel="stylesheet" href="${ctx}/resources/css/main.css">
<link rel="stylesheet" href="${ctx}/resources/css/goodsmanage.css">
<script src="${ctx}/resources/js/jquery-2.1.4.min.js"></script>
<script src="${ctx}/resources/js/jquery-form-3.51.0.js"></script>
<script type="text/javascript">
$(document).ready(function() {
$("#form1").ajaxForm(function(data) {
if (data.code != 'ok') {
alert(data.msg);
} else {
window.location.href = "${ctx}/yd/list";
}
});
});
</script>
</head>
<body>
<div class="wrapper clearfix">
<!-- 主页面开始 -->
<div class="content-wrapper">
<!--title-->
<div class="action-span">
<ol class="breadcrumb">
<li class="crumb-img"></li>
<li class="none-line">药店管理</li>
<li class="active">编辑药店</li>
</ol>
</div>
<!--middle-->
<div class="main-content ">
<input type="file" id="file1" name="file" onchange="ajaxFileUpload('1');" style="display: none">
<input type="file" id="file2" name="file" onchange="ajaxFileUpload('2');" style="display: none">
<input type="file" id="file3" name="file" onchange="ajaxFileUpload('3');" style="display: none">
<form id="form1" action="${ctx }/yd/update/" method="post">
<div class="bg-white clearfix" style="padding-bottom: 50px;">
<%-- <h1 class="detail-title">
<a class="btn btn-default" href="">下载批量导入模板</a>
<button class="btn btn-default" onclick="$('#file3').click();">批量导入客户信息</button>
<input type="file" id="file3" name="file" style="display: none" onchange="$.myUpExcel('','file3','1')">
<span style="font-size: 12px;color: red;">导入失败会弹出下载框,成功无特殊提示</span>
</h1> --%>
<h1 class="detail-title">基本信息</h1>
<div class="div_table clo-xs-8 col-xs-offset-1">
<div class="form-div clearfix">
<div class=" uesr-id-select">
<div class="col-xs-4 goods-type text-right"><span style="color: red;">*</span>药店名称:</div>
<div class="col-xs-2 dropdown">
<input class="form-control" name="pharmacy_name" value="${ydMap.pharmacy_name }" type="text" required="required">
<input type="hidden" id="id" name="id" value="${ydMap.id }" >
</div>
</div>
</div>
<div class="form-div clearfix">
<div class="uesr-id-select">
<div class="col-xs-4 goods-type text-right"><span style="color: red;">*</span>服务等级:</div>
<div class="dropdown col-xs-2">
<select class="form-control" name=