I have an on Submit for the form and a JS function that suppose to check it but it does not work.
While HTML5 form validation is typically about missing or invalid text inputs, there are other form element types that also require attention. Suppose you have a form on your website that at the bottom asks people to "accept the Terms and Conditions" or something similar.
When it comes to two-way data-binding to the way it helps us handle form validation, Angular really helps us process forms.
Just you have to track the id or name of the checkboxes. For statically you can use hard coded id of the checkboxes and for dynamically you can use the name of the field as an array and create a loop. Adding HTML5 validation to the checkbox is actually very simple.All you need to do is include a This tells the browser that the form should not be allowed to submit without the checkbox checked.The CGI script is still more reliable, as it always works regardless of whether Java Script is enabled on the client-side or not; but having this extra safety barrier is a nice thing to have in place.It makes your page much more user-friendly, and takes out the frustration of having to fill out the same form repeatedly.