Given this HTML using jQuery validate
<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>
I get this error:
Uncaught TypeError: Cannot call method 'getAttribute' of undefined
The 'name' attribute is missing:
<input id="accept-terms" name="accept-terms" type="checkbox" class="required"/>
(This took me a while to figure out so I thought I'd share the question and solution)
Also: Check the comments below, as others have posted other causes for the same exception.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With