I need to make the email address required…nothing happens when I click submit. Ideally I should get an error message saying email address required if I don’t enter one?
Help appreciated! Your code so far
Get Started
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36.
Hi,
You have some duplicate id attributes in that form. id must be (should be) unique. Look at the requirements to make sure you are using the specified id on each tag. Because of this your submit button has the wrong form= attribute. The form attribute on your submit button tag must match the id of the form.
You could use input type="submit" instead of button to avoid the need for a form attribute.
Also, I don’t believe that required is an attribute of the form tag - just input fields.
Fix those form and id attributes and validation should work as expected.