联系官方销售客服
1835022288
028-61286886
page页面中如何设置搜索为文章模块的内容呢?
<div class="dx-form dx-form-group-inputs"> <input type="text" onkeypress="if(event.keyCode==13) {dr_module_search('search_keyword');return false;}" name='keyword' value='{$keyword}' id='search_keyword' class="form-control" placeholder="关键词..."> <button onclick="dr_module_search('search_keyword')" type="button" class="dx-btn dx-btn-lg"> <i class="fa fa-search"></i> 搜索</button> </div> </div> </div> <script> // 这段js是用来执行搜索的 function dr_module_search(name) { var url="{Router::search_url($params, 'keyword', 'dayruicom')}"; var value = $("#"+name).val(); if (value) { location.href=url.replace('dayruicom', value); } else { $("#"+name).focus() dr_tips(0, "输入关键字"); } return false; } </script>
模板文件:page.html