<form action="/home/search" method="get" id="search_form"> <div class="searchBox png" id="searchBox"> <input type="text" id="searchTxt" class="searchTxt" name="shopName" value="@shopName"> <a class="searchPic h-submitBtn png" id="h-submitBtn" onclick="document:search_form.submit();"> </a> </div> </form>这里a标签可以有以下几种写法:
方法1:
<a class="searchPic h-submitBtn png" id="h-submitBtn" onclick="document:search_form.submit();">提交</a>方法2:
<a href="javascript:document:search_form.submit();">提交</a>方法3:
<a class="searchPic h-submitBtn png" id="h-submitBtn" onclick="document.getElementById('search_form').submit();">提交</a>