Here is html code for the form:
The same issue showed up for me. The reason for that error what that I was using the code:
if ($("#invalidFormId").valid()) { .... }
And the id of the form element was not valid
id
form