searchinput.jsp

来自「从零开始——JSP动态网页制作基础培训教程-源代码」· JSP 代码 · 共 44 行

JSP
44
字号
<%@page contentType="text/html;charset=gb2312"%>
<%@ include file="incoming/common.jsp"%>
<%@ include file="incoming/connectdb.jsp"%>

<html>
<head>
<title><%=title%></title>
<link href="incoming/style.css" rel="stylesheet" type="text/css">
</head>
<script Language="JavaScript">
function check_input(theForm)
{

   if (theForm.searchinput.value == "")
  {
    alert("请输入关键字。");
    theForm.searchinput.focus();
    return (false);
  }

}
</script>

<body bgcolor="#FFFFFF">
<form name="form1" method="post" action="search.jsp" onsubmit="return check_input(this)">
  <table width="370" height="175" border="0" align="center" cellpadding="0" cellspacing="0">
    <tr>
      <td width="370" height="70"><div align="center"><strong>搜索新闻</strong></div></td>
    </tr>
    <tr>
      <td height="65"><div align="center">关键词:
          <input name="searchinput" type="text" size="40" maxlength="40">
      </div></td>
    </tr>
    <tr>
      <td><div align="center">
        <input type="submit" name="Submit" value="提交">
         <input type="reset" name="Reset" value="重填">
      </div></td>
    </tr>
  </table>
</form>
</body>
</html>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?