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

2019-03-2616:25:36网站建设与开发Comments1,765 views字数 1252阅读模式
<!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>文章源自菜鸟学院-https://www.cainiaoxueyuan.com/cms/10395.html

<tr bgcolor="#FFFFFF">
<td>&nbsp;</td>
<td>
<input type="submit" name="Submit" value="马上搜索">
<font color="#666666">(不设置为不限)</font>
</td>
</tr>
</table>
</form>
</body>
</html>

文章源自菜鸟学院-https://www.cainiaoxueyuan.com/cms/10395.html
  • 本站内容整理自互联网,仅提供信息存储空间服务,以方便学习之用。如对文章、图片、字体等版权有疑问,请在下方留言,管理员看到后,将第一时间进行处理。
  • 转载请务必保留本文链接:https://www.cainiaoxueyuan.com/cms/10395.html

Comment

匿名网友 填写信息

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定