注册 登录 欢迎您到模板精:织梦模板_dede模板_免费网站模板_网站源码下载

织梦教程_免费织梦模板下载_dede模板

该栏目分享织梦建站的基础知识,从织梦CMS的安装,到织梦标签的常规调用,以及织梦的常见问题答疑都有涉及。

当前位置:首页 > 织梦教程 >

织梦DEDECMS搜索提交用a便签替换button标签方法

免费网站模板 2020-09-17 10:02 织梦教程 评论
我们用建站时,织梦默认搜索提交标签是button,有时候我们不要botton样式,就用a便签来替换。
 
原理是:在a便签里加个onclick属性,在前面form里加入id='search_form',直接上一个案例代码,就知道怎么来套用了
 
 
 
<form name="formsearch"  action="/plus/search.php"   id='search_form'>
                    <div class="searchform">
                    <input type="hidden"   name="kwtype"   value="0">
    <input name="q"   type="text"  class="input"   id="search-keyword"   value="在这里搜索..."   onfocus="if(this.value=='在这里搜索...'){this.value='';}" onblur="if(this.value==''){this.value='在这里搜索...';}" x-webkit-speech="">
                    </div>
                    <div class="search_submit">
                      <a onclick="document.getElementById('search_form').submit();"><img src="/style/picture/search_btn.jpg"   alt="Products Search"></a>
                    </div>
                </form>