jQuery提交form表单

<form id="search_form" name="search_form" method="post">   
      <input type="text" name="username" />   
</form>  
<script type="text/javascript">  
    $(function() {  
        $('#btn').bind('click', function() {  
            document.search_form.action = 'admin/queryAll.do?pid=' + pid;  //定义 action,并传参   
            $('#search_form').submit();  
        });  
    })  
</script>

 

posted @ 2015-08-10 11:30  douglasvegas  阅读(254)  评论(0编辑  收藏  举报