首页 > CMS > 帝国Empire > 正文

帝国cms 判断搜索字段的字段不能为空?

2024-08-28 12:25:49
字体:
来源:转载
供稿:网友
<!doctype html>
<html>
<head>
<meta charset="UTF-8">
<title>Untitled Document</title>
</head>

<body>
<script>
function CheckSearchForm(){
        if(document.getElementById("searchform").stitle.value=="")
        {
                alert("请输入标题");
                return false;
        }
        if(document.getElementById("searchform").swriter.value=="")
        {
                alert("请输入作者");
                return false;
        }
        return true;
}
</script>
<form name="searchform" id="searchform" method="post" action="/e/search/index.php" onsubmit="return CheckSearchForm();">
  <table width="550" border="0" align="center" cellpadding="3" cellspacing="1" class="tableborder">
    <input type="hidden" name="tbname" value="zhengshu">
    <input type="hidden" name="tempid" value="1">
    <input type="hidden" name="andor" value="and">
    <tr class="header">
      <td colspan="2">新闻搜索</td>
    </tr>
    <tr bgcolor="#FFFFFF">
      <td width="97">姓名:</td>
      <td width="388">
          <input type="hidden" name="show[]" value="title">
          <input type="hidden" name="hh[]" value="LK">
          <input name="keyboard[]" type="text" id="stitle">
      </td>
    </tr>
    <tr bgcolor="#FFFFFF">
      <td>编号:</td>
      <td>
          <input type="hidden" name="show[]" value="xingming">
          <input type="hidden" name="hh[]" value="LK">
          <input name="keyboard[]" type="text" id="swriter">
      </td>
    </tr>

        <tr bgcolor="#FFFFFF">
      <td>&nbsp;</td>
      <td>
        <input type="submit" name="Submit" value="马上搜索">
        <font color="#666666">(不设置为不限)</font>
      </td>
    </tr>
  </table>
</form>
</body>
</html>
发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表