a标签的超链接提交form表单

<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>

有以下几种写法:

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>

 

 

posted on 2015-06-24 11:06  CeleryCabbage  阅读(3654)  评论(0编辑  收藏  举报

导航