Подтвердить что ты не робот

JQuery Validate Uncaught TypeError: невозможно вызвать метод getAttribute из undefined

Учитывая этот HTML-код с помощью проверки jQuery

 <input id="accept-terms" type="checkbox" class="required"/> 
 <label for="accept-terms"> I accept the <asp:HyperLink ID="termsLink" runat="server" Target="_blank">terms and condtions</asp:HyperLink> of sale.</label>
 <label for="accept-terms" class="error-text">You must accept the terms and conditions before purchasing</label>

Я получаю эту ошибку:

Uncaught TypeError: невозможно вызвать метод getAttribute из undefined

4b9b3361

Ответ 1

Отсутствует атрибут 'name':

<input id="accept-terms" name="accept-terms" type="checkbox" class="required"/> 

(Мне потребовалось некоторое время, чтобы понять, поэтому я решил поделиться вопросом и решением)

Также: ознакомьтесь с комментариями ниже, так как другие опубликовали другие причины для одного и того же исключения.