<%@ page contentType="text/html; charset=GBK" session="false"%>

<%@ taglib uri="/cmsTag" prefix="cms"%>
<%@ page contentType="text/html; charset=GBK"%>


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
	<head>
		<%
			response.setHeader("Pragma", "No-cache");
			response.setHeader("Cache-Control", "no-cache");
			response.setDateHeader("Expires", 0);
		%>
		<title>添加模板</title>

		<link rel="stylesheet" type="text/css" href="../../style/default/main.css" />

		<!--加载 js -->

	</head>



	<body>

		<form method="post" action='../../templet/createTempletFile' name='createTempletFileForm' id='createTempletFileForm'>
			<table width="100%" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#b5d6e6">
				<tr>

					<td height="22" class="head_title">
						<img src="../../core/style/default/images/title_y.gif" />
						<span class="STYLE1">添加模板</span>
					</td>

				</tr>

				<tr>
					<td>
						<table width="100%" cellspacing=1 cellpadding=0 align=center border="0" bgcolor="#FFFFFF">
							<tr>
								<td>
									<table width="100%" cellspacing=10 cellpadding=1 align=center border="0">
										<tr>
											<td class="title_td" width="12%">
												模板名称:
											</td>
											<td width="88%">
												<input type="text" size="55" id="templetName" name="templetName" class="f_input"></input>
											</td>
										</tr>
										<tr>
											<td class="title_td" width="12%">
												后缀:
											</td>
											<td width="88%">
												<input id="templetPostfix" name="templetPostfix" type="radio" value="jsp" checked />
												<span class="STYLE12">JSP</span> &nbsp;
												<input id="templetPostfix" name="templetPostfix" type="radio" value="html" />
												<span class="STYLE12">HTML</span>


											</td>
										</tr>



									</table>

								</td>
							</tr>
						</table>
					</td>
				</tr>
				<tr>
					<td class="feet" colspan="2" />
				</tr>
			</table>


			
			<center>
				<button type="button" id="save" onclick='javascript:submitCreateTempletFileForm();'>
					<img src="../../core/style/default/images/add-act.png" alt="" />
					确认
				</button>
				&nbsp;
				<button type="button"  id="save" onclick='javascript: window.close();'>
					<img src="../../core/style/default/images/cross1.png" alt="" />
					取消
				</button>
				
			</center>




		</form>
	</body>

</html>

<script type="text/javascript">

function submitCreateTempletFileForm()
{
	var patrn=/^(\w){0,60}$/;


	var templetName=document.getElementById('templetName').value;
	var templetPostfix=document.getElementById('templetPostfix').value;
	
	//换成正则
	if(!patrn.test(templetName))
	{
		alert('模板名称只可是字符');
		return;
	}
	
	if((templetPostfix.indexOf('jsp') == -1) && (templetPostfix.indexOf('html') == -1))
	{
		alert('模板后缀名称错误');
		return;
	}
	
	

}



</script>
