模板组件:header_search.tpl 全站搜索框

HTML代码
<form class="navbar-form navbar-right ff-search" action="{$root}index.php?s=vod-search-name" method="post" role="search">
<div class="input-group input-group-sm">
<span class="input-group-addon"><a href="javascript:;" class="ff-text"><span class="glyphicon glyphicon-record"></span></a></span>
<input type="text" class="form-control ff-wd" name="wd" placeholder="请输入影片名称" value="{$search_wd}">
<span class="input-group-btn">
<button type="submit" class="btn btn-default" data-module="news" data-action="{:ff_url('news/search',array('name'=>'FFWD'), true)}">搜资讯</button>
<button type="submit" class="btn ff-btn-play" data-module="vod" data-action="{:ff_url('vod/search',array('name'=>'FFWD'), true)}">搜索</button>
</span>
</div>
</form>

CSS代码
.ff-search {
}
.ff-search .ff-wd{
}
#ff-site-hot{
}



JS代码
feifei.search.submit();//表单点击提交
feifei.search.keydown();//表单回车提交
feifei.search.autocomplete();//搜索联想下拉
feifei.search.hot();//后台自定义热门搜索

 调用代码
<include file="Block:header_search" />

4 个评论

我分开写input输入框 下面资讯搜索伪静态就没用了 规则里面是有的news-search-name-(:any)===news-Name-(:any) 怎么回事啊 求解

<form class="ff-search" id="ff-search" role="search" action="{$root}index.php?s=vod-search-name" method="post">
<input type="text" class="form-control" id="ff-wd" name="wd" placeholder="请输入影片名称" value="{$search_wd}">
<button type="submit" class="btn-vod" data-module="vod" data-action="{:ff_url('vod/search',array('name'=>'FFWD'), true)}">搜视频</button>
</form>
<form class="ff-search" id="ff-search" role="search" action="{$root}index.php?s=news-search-name" method="post">
<input type="text" class="form-control" id="ff-wd" name="wd" placeholder="请输入资讯名称" value="{$search_wd}">
<button type="submit" class="btn-news" data-module="news" data-action="{:ff_url('news/search',array('name'=>'FFWD'), true)}">搜资讯</button>
</form>
回车伪静态3.5修复了 js里面的事件没有判断
deinfo

deinfo 回复 老谭

我是点击的 不是按回车的 按回车的问题 我前几天也发帖子了。。。。。
那是因为js里面只监听一个表单事件 也就是监听#ff-search 3.5后是监听 .ff-search(多个表单也可以了)

要回复文章请先登录注册