I am using a form which does inline validation using jquery!
and i saw another inline validation method
i tried to integrate the pop up error which exits in 2nd one to 1st one but failed as i am new to jquery ! Can some one tell me how to do it as the 2nd code is bit complex to me . :(
If i can make the code something like highlighted bcos already the validation is being done!
and i saw another inline validation method
i tried to integrate the pop up error which exits in 2nd one to 1st one but failed as i am new to jquery ! Can some one tell me how to do it as the 2nd code is bit complex to me . :(
Code:
function validateEmail(){
//testing regular expression
var a = $("#email").val();
var filter = /^[a-zA-Z0-9]+[a-zA-Z0-9_.-]+[a-zA-Z0-9_-]+@[a-zA-Z0-9]+[a-zA-Z0-9.-]+[a-zA-Z0-9]+.[a-z]{2,4}$/;
//if it's valid email
if(filter.test(a)){
email.removeClass("error");
emailInfo.text("Valid E-mail please, you will need it to log in!");
emailInfo.removeClass("error");
return true;
}
//if it's NOT valid
else{
email.addClass("error");
emailInfo.text("Stop cowboy! Type a valid e-mail please :P");
[B]promptText = "Valid E-mail please, you will need it to log in!";[/B]
[B]buildPrompt(promptText);[/B]
emailInfo.addClass("error");
return false;
}
}
Comment