判断输入框是否为空 输入框为空
时间 :
2023-05-15
编辑 :创始人
<script type="text/javascript">
function My() {
var s = document.forms["fname"]["keyword"].value;
if (s == null || s == "") {
alert("请输入查询内容");
return false;
}
}
</script>
| <form action="/search/" fuzzy=0 method="get" name="fname" onsubmit="return My();"> | |
| <div style="width:950px;"> | |
| <div style="text-align:center;color:#e6d88c;">温馨提示</div> | |
| <br /> | |
| <div style="line-height:24px;"> ***********. </div> | |
| </div> | |
| <!-- select --> | |
| <div class="select"> | |
| <div class="select_bg"> | |
| <select name="field" class="select_bg" style="width:88px;height:34px; padding: 2px 0;" > | |
| <option value="title">姓名</option> | |
| <option value="author">身份证号</option> | |
| <option value="source">证书编号</option> | |
| </select> | |
| </div> | |
| </div> | |
| <!-- select --> | |
| <input type="text" name="keyword" /> | |
| <input style='display:none' /> | |
| <p>请输入报考学员的身份证号、姓名、证书编号 </p> | |
| <button type="submit" class="btn" value="立即查询" > 立即查询</button> | |
| <ul class="ul_finale" id="finale"> | |
| </ul> | |
| </form> |
