js_input.php页面中<script language="javascript">
function check_input()
{
var wd = document.getElementById("keyword").value;
if(wd.length==0)
{
return false;
}else{
return true;
}
}
</script> <form autocomplete="off" id="myform" action="index_rs.php" method="get" onsubmit="return check_input()">
<!-- <input type="hidden" name="act" value="search" />-->
<input name="wd" id="keyword" style="height:22px;width:400px;margin-left:100px;line-height:22px;font-size:14px;">
<input name="" type="submit" style="height:27px;width:100px;margin-left:10px;font-size:14px;
line-height:22px;" value="立即搜索">
</form>
现页面中,1如果输入为空时,不提交,只是刷新本页面
2如果输入有值时,就提交
针对上面的代码,如何修改呀,或是怎么实现上面的二点功能呀,
function check_input()
{
var wd = document.getElementById("keyword").value;
if(wd.length==0)
{
return false;
}else{
return true;
}
}
</script> <form autocomplete="off" id="myform" action="index_rs.php" method="get" onsubmit="return check_input()">
<!-- <input type="hidden" name="act" value="search" />-->
<input name="wd" id="keyword" style="height:22px;width:400px;margin-left:100px;line-height:22px;font-size:14px;">
<input name="" type="submit" style="height:27px;width:100px;margin-left:10px;font-size:14px;
line-height:22px;" value="立即搜索">
</form>
现页面中,1如果输入为空时,不提交,只是刷新本页面
2如果输入有值时,就提交
针对上面的代码,如何修改呀,或是怎么实现上面的二点功能呀,
解决方案 »
- 网站被劫持,求高手指点
- php读取csv文件 时每一项的开头如果是中文 将会被忽略, 怎么办用fgetcsv读取的
- 使用左关联查询后,如何用PHP显示出字段的数据
- 将多个一维数组转换成一个二维数组,并求出[2]项值的个数。
- php中imap_open()如何使用
- 动态生成变量并把生成的变量初始数组
- error_reporting(7)后不再会记录错误日志了吗?
- 又出现一个新问题
- session的问题解决方法(php4.3.2版)
- 我配php运行环境是下载的phptriad v2.11,有时为什么phpamyadmin打不开?是要修改点什么吗?
- 高分求解:总分分段统计(累计)
- str_replace函数的问题,在线等
return false;