You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
gzf/WebRoot/admin/materialAdd.jsp

85 lines
3.4 KiB

<%--
Created by IntelliJ IDEA.
User: pan
Date: 2020/6/10 0010
Time: 6:46
To change this template use File | Settings | File Templates.
--%>
<%@ page language="java" pageEncoding="UTF-8"%>
<%@ taglib uri="/struts-tags" prefix="s"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<html>
<head>
<c:import url="../head.jsp"/>
<script>
function validateIt(inputelement){
if(inputelement.validity.patternMismatch){
inputelement.setCustomValidity('只允许输入英文字母');
}else{
inputelement.setCustomValidity(''); //输入内容符合验证条件
}
return true;
}
</script>
</head>
<body>
<div class="box round first" style="margin:15px;">
<h2>录入数据</h2>
<div class="block">
<form method="POST" action="<%=basePath%>admin/material/add.do">
<table class="form">
<tbody>
<tr>
<td class="col1">
<label>资料名</label>
</td>
<td class="col3">
<input name="applicationMaterial.materialName" required value="" type="text" class="medium">
</td>
</tr>
<tr>
<td class="col1">
<label>资料类型</label>
</td>
<td class="col3">
<select name="applicationMaterial.formType" required class="medium">
<option value="">请选择资料类型</option>
<option value="text">文本</option>
<option value="doc">图片</option>
</select>
</td>
</tr>
<tr>
<td class="col1">
<label>资料表单名</label>
</td>
<td class="col3">
<input name="applicationMaterial.formName" required class="medium" pattern="[a-zA-Z]+" oninvalid="validateIt(this)" oninput="validateIt(this)"/>
<span class="text-danger">只允许输入英文字母</span>
</td>
</tr>
<tr>
<td class="col1">
<label>资料表单顺序</label>
</td>
<td class="col3">
<input name="applicationMaterial.formOrder" class="medium" type="number" min="0">
</td>
</tr>
<tr>
<td colspan="2">
<button type="submit" class="btn btn-blue">提交数据</button>
</td>
</tr>
</tbody>
</table>
</form>
</div>
</div>
</body>
</html>