美文网首页
帝国cms 判断搜索字段的字段不能为空?

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

作者: a力_91ec | 来源:发表于2018-12-08 02:40 被阅读0次

    <!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>

    相关文章

      网友评论

          本文标题:帝国cms 判断搜索字段的字段不能为空?

          本文链接:https://www.haomeiwen.com/subject/nkpfhqtx.html