I used jQuery validator and bound it to a click event like this :
var validator = $("#formId").data('validator');
When I click the first time I load the page I get the error “validator undefined”, but when I refresh the same page it starts working.
any ideas?
Found the answer:
I use jQuery mobile and I had to turn the ajax off like this :