如何在模糊事件后调用提交按钮单击事件

时间:2014-08-04 05:54:21

标签: javascript jquery html

我创建了一个表单,有三个字段firstname,lastname,email。 3个不同的按钮 添加更多,删除,提交。

如果用户点击添加按钮,那么我们必须再添加4个字段,名字,姓氏,电子邮件,删除按钮。

如果点击删除按钮,则删除该4个字段。

然后点击提交按钮,然后提交表单。

现在一个验证是,如果电子邮件文本字段失去焦点,那么检查天气是否存在电子邮件。然后点击其他人。

每件事情都顺利但按钮的点击事件在模糊后无效。

 /*To check weather email address is exist or not on lostfocus event of the email text box start here */
    $(".userEmail").live("focusout",function(){
        startLoading();
        value=$(this).val();
        element=$(this);
        $(this).live("focus");
        $.ajax({
            async: false,
            url:"isEmailExist.html",
            data:{email:value},
            success : function(data){
                endLoading();
                if(data.returnVal == "true")
                {
                    element.addClass("emailExistAlready")
                }   
                else
                {
                    element.removeClass("emailExistAlready");                       
                }
            },
            error:function(jqXHR)
            {
                errorAjax();
                endLoading();
                ajaxErrorCode(jqXHR);
            }
        });
    });
    /*To check weather email address is exist or not on lostfocus event of the email text box end here */

    /*To add more element on click of the link of add new User start here*/
    $("#addMoreUser").live("mousedown",function(){
        $("#addNewUser").append($(".addUserClone").html());
    });
    /*To add more element on click of the link of add new User end here*/

    /*To remove the elemnts on click of the remvoe botton start here */
    $(".deleteField").live("mousedown",function(){
        $(this).parent().parent("tr").remove();
    });
    /*To remove the elemnts on click of the remvoe botton end here */

我已经使用mousedown添加和删除按钮,但我不能使用mousedown作为submmit但是我能做什么?

0 个答案:

没有答案
相关问题