Forms: Validation and Required Fields

intermediate
By FrontendAtlas Editorial · Updated Oct 23, 2026
Build a signup form using native HTML5 validation: required fields, type constraints, minlength, and pattern. The browser should block invalid submissions without custom JS changes, and existing JS/CSS should remain untouched for tests.

Solution idea

Native HTML validation should enforce required fields and correct formats before submission. Using type=email, minlength, and pattern rules lets the browser handle most validation without custom JS. The existing JS and CSS rely on these attributes, so changing markup is the key step and should be kept minimal and precise.

Public interview reports

These public, self-reported interview accounts informed this practice version. The exercise is modelled on reported rounds, not copied from them, and the reports are not verified official questions or endorsements.

Reported in a public Tesla interview account. Tesla frontend interview questions

Reported in a public Capital One interview account. Capital One frontend interview questions