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>
答案 0 :(得分:3)
在表单和按钮(或链接)中添加ID,例如id="my_form"
&amp; id="my_btn"
,然后您可以在点击链接时提交表单,如下所示:
<!-- Code should be placed anywhere after the form-->
<script>
document.getElementById("my_btn").onclick = function () {
document.getElementById("my_form").submit();
return false;
}
</script>
答案 1 :(得分:0)
试试这个,
$("#buttonId").click(function() { $("form#formID").submit(); });