Click here to Skip to main content
16,018,418 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
jquery on blur event not working

JavaScript
$(document).on("blur","#txtPasswordReg",function(e){
        if(!(passwordCheck($("#txtPasswordReg").val()))){
            $(this).css('color', 'red');
            alert("Please Enter Valid Password");
        }
        else if($(this).val()==""){
            $(this).css('color', 'red');
        }
        else{
            $(this).css('color', 'black');
        }
    });
Posted

1 solution

JavaScript
$(function(){
    $("#txtPasswordReg").blur(function(){
       if($(this).val()==""){
            $(this).css('color', 'red');
        }
         else if(!(passwordCheck($(this).val()))){
            $(this).css('color', 'red');
            alert("Please Enter Valid Password");
        }

        else{
            $(this).css('color', 'black');
        }
    });
});
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900