-1

下面是我试图覆盖的代码:

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);
    }
};

:::::::::::::::::::::::::::::::::::::::::::::::::: ::::::: 我的html表单如下:

<form action="/cgi-bin/sla.php" id="vip_login" method="post" name=
"vip_login">
    <div class="usernameBox">
        <label class="placeholder" for="vipname">输入邮箱名&lt;/label>
        <input class="username" id="vipname" name="username" tabindex="1"
        type="text" value=""><span class="vipDomain">@vip.sina.com</span>
        <a class="clearname" href="#"></a>
    </div><span class="loginError" style="visibility:hidden"></span>

    <div class="passwordBox">
        <input class="password" id="vippassword" name="password" tabindex=
        "2" type="password" value=""> <label class="placeholder" for=
        "vippassword">输入密码</label>
    </div>

    <div class="mailvsn" style="display:none">
        <input class="vsn" id="vipvsn" maxlength="6" name="vsn" tabindex=
        "3" type="text" value=""><span class="vipDomain"><a class=
        "vipfindVdun" href="http://vdun.sina.com.cn/report_loss" target=
        "_blank">微盾挂失</a></span> <label class="placeholder placeholder1"
        for="vipvsn">输入微盾动态码</label>
    </div>

    <div class="loginSetting clearfix">
        class="forgetPas"&gt;忘记密码? <input checked="checked" id="store2"
        tabindex="4" type="checkbox"> <label for="store2">下次自动登录</label>
        <input checked="checked" id="ssl2" tabindex="5" type="checkbox">
        <label for="ssl2">SSL安全登录</label>
    </div>

    <div class="safeTip tip24">
        建议在网吧或公共电脑上取消保持登录选项。
    </div><!--若没有验证码,设置display:none-->

    <div class="checkcodeBox" style="display:none;">
        <div class="clearfix">
            <input id="vipcheckcode" name="checkcode" type="text" value=
            "验证码"> <img alt="" class="checkcode"> <label class=
            "placeholder" for="vipcheckcode">验证码&lt;/label>
        </div>

        <p class="clearfix"><a href="">看不清?换一个&lt;/a>按右图填写,不区分大小写</p>
    </div><a class="loginBtn" href="#" tabindex="3">登录</a> <span style=
    "visibility: hidden;">&nbsp;</span>
</form>
4

2 回答 2

0

尝试这个,

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

于 2013-08-16T02:49:52.167 回答
0

jQuery 提供了一个trigger功能来做你想做的事。因此,如果您有一个带有提交按钮的表单,我们将调用该按钮#submit,您将执行以下操作:

$('#someElement').click(function() {
  $('#submit').trigger('click');
 });

功能很简单,当元素#someElement被点击时,jQuery 会触发#submit按钮的点击事件,而不会发生物理上的事件。就像点击馅饼一样简单!

于 2013-08-16T01:51:07.227 回答