In the login.phtml, what is the difference between validator and validate - Could someone explain what is the meaning of each of the lines below
function onepageLogin(button)
{
if(loginForm.validator && loginForm.validator.validate()){
button.disabled = true;
loginForm.submit();
}
}
Thanks.
loginForm.validator just checks the existence of the object (go on if it exists) and
loginForm.validator.validate() calls the function validate() of the object (and if the function returns true, too, then the commands inside the if-clause will be executed).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With