Hey Guys,
I am using liveValidation and it works great although i’m just trying to add an IF statement to it, but i can’t seem to get it to work.
Here is my JS:
[JS]
var firstname = new LiveValidation(‘firstname’, { validMessage: ’ ', wait: 750} );
firstname.add( Validate.Presence, { failureMessage: “Please Complete” } );
var lastname = new LiveValidation('lastname', { validMessage: ' ', wait: 750} );
lastname.add( Validate.Presence, { failureMessage: "Please Complete" } );
if (document.form.email == "" || document.form.fax == "") {
var email = new LiveValidation('email', { validMessage: ' ', wait: 750} );
email.add( Validate.Presence, {failureMessage: "Please enter an e-mail address" } );
email.add( Validate.Email, {failureMessage: "Please enter a correct e-mail address" } );
var fax = new LiveValidation('fax');
fax.add( Validate.Numericality );
fax.add( Validate.Presence, {failureMessage: "Please Complete" } );
} else if (document.form.email != "" || document.form.fax != "") {
var email = new LiveValidation('email', { validMessage: ' ', wait: 750} );
email.add( Validate.Email, {failureMessage: "Please enter a correct e-mail address" } );
var fax = new LiveValidation('fax');
fax.add( Validate.Numericality );
}
[/JS]
Any ideas why it won’t work??
All the other ones work except for those last two.
Thanks in advance!