<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8"%>
	<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%> 
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<meta name="renderer" content="webkit|ie-comp|ie-stand">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
<meta http-equiv="Cache-Control" content="no-siteapp" />
<link href="${pageContext.request.contextPath }/common/admin/css/H-ui.min.css" rel="stylesheet" type="text/css" />
<link href="${pageContext.request.contextPath }/common/admin/css/H-ui.login.css" rel="stylesheet" type="text/css" />
<link href="${pageContext.request.contextPath }/common/admin/css/style.css" rel="stylesheet" type="text/css" />
<link href="${pageContext.request.contextPath }/common/admin/lib/Hui-iconfont/1.0.1/iconfont.css"rel="stylesheet" type="text/css" />
<link href="${pageContext.request.contextPath }/common/other/kingedit/themes/default/default.css" rel="stylesheet" type="text/css" />
<title>修改商品</title>
</head>
<body>
<div class="pd-20">
	<form  class="form form-horizontal" id="form-paperList"  >
		<input name="id" id="id" type="hidden" value="${id}">
		<input name="type" id="type" type="hidden" value="${type}">
	
		
		<div class="row cl">
			<label class="form-label col-2"><span class="c-red">*</span>修改内容：</label>
			<div class="formControls col-8">
				<input id="content" name="content" type="text" class="input-text" value="${content }" placeholder="">
			</div>
		</div>
		<div class="row cl">
			<div class="col-10 col-offset- 2 text-c">
				<!-- <button onClick="return admin_addGoods();" class="btn btn-primary radius" type="submit"><i class="Hui-iconfont">&#xe632;</i> 保存</button> -->
				<button onClick="updatePaperList();" type="button" class="btn btn-primary radius" >
					<i class="Hui-iconfont">&#xe632;</i>保存
				</button>
			</div>
		</div>
	</form>
</div>
<script type="text/javascript" src="${pageContext.request.contextPath }/common/admin/lib/jquery/1.9.1/jquery.min.js"></script>
	<script type="text/javascript" src="${pageContext.request.contextPath }/common/admin/lib/layer/1.9.3/layer.js"></script>
	<script type="text/javascript" src="${pageContext.request.contextPath }/common/admin/js/H-ui.js"></script>
	<script type="text/javascript" src="${pageContext.request.contextPath }/common/admin/js/H-ui.admin.js"></script>
	<script type="text/javascript" src="${pageContext.request.contextPath }/common/admin/js/tips.js"></script> 
	<script type="text/javascript" src="${pageContext.request.contextPath }/common/admin/js/ueditor.all.min.js"></script> 
	<script type="text/javascript" src="${pageContext.request.contextPath }/common/admin/js/ueditor.config.js"></script>
	<script type="text/javascript" src="${pageContext.request.contextPath }/common/js/utils/tools.js"></script>
	<script type="text/javascript" src="${pageContext.request.contextPath }/common/js/utils/jquery-1.9.1.min.js"></script>
	<script type="text/javascript" src="${pageContext.request.contextPath }/common/other/kingedit/kindeditor.js"></script>
	<script type="text/javascript" src="${pageContext.request.contextPath }/common/other/kingedit/lang/zh_CN.js"></script>
<script type="text/javascript">


$(document).ready(function(){

});

/*商品-数据验证*/
function updatePaperList(){
	
	
	
	if($("#type").val()==3){
		//商品名称数据验证
		if(!commonTypeJdg('content','digital',null,true)){
			layer.msg("分数必须为数字",{icon: 2,time:2000});
			return false;
		}
	}else{
		 //商品名称数据验证
		if(!commonLengthJdg('content',1,200,null,true)){
			layer.msg("不能为空!且长度为1-100位",{icon: 2,time:2000});
			return false;
		}
	}
	$.ajax({
		url: '${pageContext.request.contextPath }/admin/questionPaper/updatePaper',
		data: $("#form-paperList").serialize(),
		dataType:'json',//服务器返回json格式数据
		type:'post',	//HTTP请求类型
		error:function(data){
			//alert("-----error:function----->>" + data);
      	  	layer.msg("修改失败!",{icon: 5,time:2000});
        },
        success:  function(data){
        	//alert("----success------>>" + data);
      	  	//layer.msg(data.status,{icon: 1,time:2000});
      	  	if(data.flag){
      		  layer.msg(data.info,{icon:1,time:2000},function(){
      			//parent.$("#"+$("#id").val()).text($("#content").val());
        	  });
      	  	}else{
      	  		layer.msg(data.info,{icon:5,time:3000});
      	  	}
      	  
        }
	});
	
	
}

</script>
</body>
</html>