On the checkout page in magento i am getting this error:
VarienForm is not defined
[Break On This Error]
var loginForm = new VarienForm('login-form', true);
But when I enter my username and password, it logs me in. Can I remove the error?
PS: I have moved varien js library to the footer.
The error means that you script isn’t working – that’s it. The fact, that you are being logged in has nothing to do with the VarienForm object – this is a HTML form with submit button, so of course it submits and logs you in. VarienForm’s main task is to validate form data before submit. So usually if you try to log in with empty password or login, VariendForm prevents form from being submitted. In your case, when script is broken, it just won’t do anything before submit.
So, sorry, but the best advice would be – don’t move this library. Yes, you can fix every single page, where you will meet this error, but it will take a lot of time. And if you will install 3rd party extensions, you will most likely have to modify them too. I don’t think, that such optimization is worth it.
PS. And unless you are toying with Magento 2, VarienForm is based on Prototype, not jQuery, so your tags are incorrect and SnapGravy’s code most likely won’t work.