0

jQuery

 <script type="text/javascript">
    var conf = {
        isVip:false,
        isMem:false
    };
    var sinaSSOConfig = {
        entry : 'mail', //
        loginType : 0,
        setDomain : true,
        pageCharset :'UTF-8',
        timeoutEnable : true,
        loginTimeout : 45000,
        customInit : function() {
            sinaSSOController.setLoginType(3);
    },
        customLoginCallBack : function(status){
            conf.loginCallBack(status);
        }
    };

 

<form name="vip_login" method="post" action="la.php">                       
 href="#" class="loginBtn">submit</a>
</form>

我怎样才能让这个按钮提交上面的表格?

<a href="#" onclick="return false;">loading</a>
<a href="#" onclick="return false;"><span class="vip"></span>submit</a>
4

2 回答 2

3

Add an id to your form and to your button (or link), for example id="my_form" & id="my_btn", then you can submit the form when the link is clicked like this:

<!-- Code should be placed anywhere after the form-->
<script>
document.getElementById("my_btn").onclick = function () {
    document.getElementById("my_form").submit();
    return false;
}
</script>
于 2013-08-16T02:15:03.573 回答
0

尝试这个,

$("#buttonId").click(function() { $("form#formID").submit(); });

于 2013-08-16T02:51:00.110 回答