java菜鸟 送分 小问题

qq_16609613 2014-09-03 10:46:55
<!-- 搜索 -->
<script>
function query()
{
var text = $("#textInfo").val();
//content = rtrim(content);
if(text=='关键词搜索'||text.trim().length==0)
{

return;
}else
{
/* location.href="TibleSearchAction"; */
window.location.href="TibleSearchAction?text="+encodeURI(encodeURI(text));
}
//"
}
</script>
<!-- end -->

<form action="" method="">
<input id="textInfo" name="text" type="text" value="请输入关键词"
onfocus="if(this.value=='关键词搜索') this.value=''; this.style.color='#666';"
onblur="if(this.value=='') {this.value='关键词搜索';this.style.color='#999';}" style="width:150px; margin-right:5px" />
<input type=submit value=""
style="background:url(<%=basePath%>HTML/images/go.jpg); width:40px;"onclick="query();" >
</form>

点击搜索跳转不了action啊 ! 求帮助 帮我改一下吧
...全文
108 7 打赏 收藏 转发到动态 举报
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
LJ_KB 2014-09-03
  • 打赏
  • 举报
回复
楼上说的很对,先修改type="button"试试
aaron_gzt 2014-09-03
  • 打赏
  • 举报
回复
搜索按钮的type改成button来试试吧,type="submit"的话点击的时候提交到form表单中action属性指定的请求中的
qq_16609613 2014-09-03
  • 打赏
  • 举报
回复
OK le
shixitong 2014-09-03
  • 打赏
  • 举报
回复
先看看query方法有没有进去
桃子_ 2014-09-03
  • 打赏
  • 举报
回复
搜索按钮改为 type="button"再试试
LOVE-漂泊 2014-09-03
  • 打赏
  • 举报
回复
相对路径 和绝对路径都试一下
scott_129 2014-09-03
  • 打赏
  • 举报
回复
type改为button。为submit的时候会直接提交你的表单那个action路径的。

81,092

社区成员

发帖
与我相关
我的任务
社区描述
Java Web 开发
社区管理员
  • Web 开发社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧