我們用織夢建站時,織夢默認搜索提交標簽是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>