I am new to web development, and I need advice about how to do this thing. What is the best and usual way for this kind of functionality?
Directly over the Submit button, there is three checkboxes. The first one must be checked in order for the consumer to move to the next page. If it isn’t checked I need to notify the consumer upon submit that they need to check it in order to continue.
JS:
HTML:
On clicking the submit button, the JS function validate is executed. If the checkbox with id “id-of-checkbox-1” is not checked, the user gets an alert and the function returns false, otherwise it returns true. In the onsubmit attribute of the form, it says
return validate();as the result of the function has to be returned to the browser as well. If this returns false, the form is not submitted; else it is.