<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/commons/taglibs.jsp" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!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">
<%@ include file="/commons/meta.jsp"%>
<base href="<%=basePath%>">
<title>创建模型</title>
<script>
function submitForm(){
	try{
		 //用jquery中的ajax方法，向服务器提交请求 
		jQuery.ajax({ 
			 type: "POST", 
			 url: "${ctx}/procModelMgr/create.do", 
			     data: $('#modelForm').serialize(),
			     success: function(resp)
					{
						if(resp.errorMsg.length==0){
							alert("操作成功!请您在新窗体设计流程！");
							openWindow(resp.path, '流程在线设计');
							art.dialog.opener.location.reload();
						}else{
							alert(resp.errorMsg);
						}
						
					}
			   }); 
	}catch(e){}
	return false;
}

	$(document).ready(function() {
		$('#id-input-file-1 , #id-input-file-2').ace_file_input({
			no_file:'No File ...',
			btn_choose:'Choose',
			btn_change:'Change',
			droppable:false,
			onchange:null,
			thumbnail:false //| true | large
			//whitelist:'gif|png|jpg|jpeg'
			//blacklist:'exe|php'
			//onchange:''
			//
		});
		$.Tipmsg.r=null;
		$("#modelForm").Validform({
			tiptype:function(msg){
				alert(msg);//验证提示信息
			},
			tipSweep:true,
			datatype:{
				"zh1-10":/^[\u4E00-\u9FA5\uf900-\ufa2d\a-zA-Z_]{1}[\u4E00-\u9FA5\uf900-\ufa2d\a-zA-Z_0-9()（）-]{1,20}$/,
				"en1-10":/^[a-zA-Z_]{1}[a-zA-Z_0-9-]{1,20}$/
			},
			btnSubmit:"#submitButton",//提交按钮
			callback:submitForm//验证通过后提交函数

		});
		
		/* $('#key').keyup(trimkeyup); */
	});
	
</script>
</head>
<body>
			<form action="${ctx}/procModelMgr/create.do" method="post" id="modelForm">
				<div class="main-container" id="main-container">
			<div class="panel panel-primary">
				
				<div class="panel-body">
					<table class='table table-bordered' border="0" cellspacing="0"
						cellpadding="0" id="myTable">
					<!-- 存放表单的区域 -->
				
				<tr>   
					<th>
						模型名称<font color="red">*</font>：
					</th>
				    <td>
				    	<input type="text" name="name" value="" datatype="zh1-10" errormsg="模型名称不能以数字开头，且不能包含空格，请您重新填写!"  nullmsg="请您填写模型名称"  style="width:300px" id="name"  class="validate[required,length[0,100]]"/>
				    </td>
				</tr>
				
				
				<tr>
					<th>
						模型KEY<font color="red">*</font>：
					</th>
				    <td>
				    	<input type="text" name="key" value="" datatype="en1-10"
				    	errormsg="模型KEY不能以数字开头，且不能包括空格和汉字，请您重新填写!"  nullmsg="请您填写模型KEY"  style="width:300px" 
				    	id="key"  class="validate[length[0,100]]"
				    	onKeypress="javascript:if(event.keyCode == 32)event.returnValue = false;"/>
				    </td>
				</tr>
				
				
				<tr>
					<th>
						模型描述：
					</th>
				    <td>
				    	<textarea id="description" name="description" style="width:300px;height: 50px;"></textarea>
				    </td>
				    
				</tr>

				</table>
				<div class="col-md-offset-1 col-md-9" style="text-align: center;">
						<button type="button" class="btn btn-sm btn-primary"
							id="submitButton" >
							保存
							<i class="ace-icon fa fa-save bigger-110"></i>
						</button>
					</div>
				</div>
			</div>
		</div>
			</form>
			
			
</body>
</html>