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.
Best Answer
Take a look at js/prototype/validation.js
Then take a look at js/mage/adminhtml/form.js or (/js/varien/form.js)
then
validator
is a variable(see this.validator = new Validation..)
that store the validation instance.See Invoke validation