|
3#
楼主 |
发表于 2013-8-10 18:17:44
|
只看该作者
回复 2# laoya
谷歌站内搜索插件引用了,效果是,输入内容进行搜索后,页面直接跳转至google的官方搜索页面,我想要的不是这个效果。
贴下我用的代码:
<html>
<head>
<meta http-equiv='Content-Type' content='text/html; charset=utf-8' />
</head>
<body>
<form method="post" action="index.php?_m=mod_product&_a=prdlist" onsubmit="javascript:return check_prdsearch_info(this);" id="prdsearchform" name="prdsearchform">
<input type="text" value="" id="prd_keyword" name="prd_keyword"><input type="submit" value="搜索" id="prdsearch_submit" name="prdsearch_submit">
</form>
<script language="javascript" type="text/javascript">
<!--
function check_prdsearch_info(thisForm)
{
if (/^s*$/.test(thisForm.elements["prd_keyword"].value))
{
alert("请输入关键字!");
thisForm.elements["prd_keyword"].focus();
return false;
}
return true;
}
-->
</script>
</body>
</html> |
|