📄 addcar.jsp
字号:
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme() + "://"
+ request.getServerName() + ":" + request.getServerPort()
+ path + "/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">
<title>My JSP 'addCarTeam.jsp' starting page</title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<link rel="stylesheet" type="text/css" href="cssjs/wang.css">
</head>
<link href="<%=request.getContextPath()%>/cssjs/comcss.css" rel="stylesheet" type="text/css">
<script language="JavaScript" src="<%=request.getContextPath()%>/cssjs/comjs.js"></script>
<script language="javascript" src="<%=request.getContextPath()%>/cssjs/calendar.js"></script>
<script type="text/javascript">
function check()
{
var x = document.form1.cardId.value
var y = document.form1.carDriverId.value
var z = document.form1.teamid.value
if(x=="")
{
alert("车牌号不能为空");
return false;
}
if(y=="")
{
alert("驾驶员编号不能为空");
return false;
}
if(z=="")
{
alert("所属车队不能为空");
return false;
}
else
{
return up();
}
}
function up()
{
var x = document.form1.carDriverId.value
if(isNaN(x))
{
alert("驾驶员编号必须为整数");
return false;
}
else
{
return true;
}
}
</script>
<body>
<h2 align="center" class="top">
添加一辆车
<hr>
<br>
</h2>
<form action="addCar.do" method="post" name="form1" onsubmit="return check();">
<table align="center" border="1" cellpadding="0" bordercolor="#ccccc">
<tr>
<td >
车牌号
</td>
<td>
<input type="text" name="cardId">
</td>
</tr>
<tr>
<td >
驾驶员编号
</td>
<td>
<input type="text" name="carDriverId">
</td>
</tr>
<tr>
<td >
所属车队
</td>
<td>
<select name="teamid">
<option>--选择车队--</option>
<option value="1">
第一车队
</option>
<option value="2">
第二车队
</option>
<option value="3">
第三车队
</option>
<option value="4">
第四车队
</option>
</select>
</td>
</tr>
<tr>
<td>
<input type="submit" value="确认">
</td>
<td>
<input type="reset" value="取消">
</td>
</tr>
</table>
</form>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -