Here is html code for the form:
In my case the error was because the validator was being called too early. I moved the code to a seperate function and called it using delay method of underscore.js. Worked like a charm.
_.delay(doValidations); function doValidations() { ... });