addgoods.jsp

来自「老牌java开发的物流管理系统 详细的我也没有怎么看 好像是恒基的」· JSP 代码 · 共 97 行

JSP
97
字号
<%@ 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="styles.css">
	-->

	</head>
<script type="text/javascript">
    function check()
    {
      var x = document.form1.commodityId.value
      var y = document.form1.commodityName.value
      
      if(x=="")
      {
        alert("商品编号不能为空");
        return false;
      }
       if(y=="")
      {
        alert("商品名称不能为空");
        return false;
      }
      else
      {
       return number();
      }
    }
     function number()
    {
      var num = document.form1.commodityId.value;
      if(isNaN(num) || num>9999)
      {
        alert("编号必须为小于五位数的整数");
        return false;
      }
      else
      {
       return true;
      }
    }
    </script>
	<body >
		<h2 align="center">
			添加商品的分类
		</h2>
		<form action="addGoodsType.do" method="post" name="form1" onsubmit="return check();">
			<table align="center" border="1" cellpadding="0" width="35%" height="18%"
				bordercolor="gray">
				<tr>
					<td>
						商品分类编号
					</td>
					<td>
						<input type="text" name="commodityId">
					</td>
				</tr>
				<tr>
					<td>
						商品分类名称
					</td>
					<td>
						<input type="text" name="commodityName">
					</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 + =
减小字号Ctrl + -
显示快捷键?