The required attribute, the pattern attribute, the maxlength limit and every check your JavaScript performs run inside the browser. The browser belongs to the person using it, and they can change any of it. This is not a flaw to be worked around; it is the nature of the arrangement.
What can be changed
Developer tools let anyone edit the live page. A required attribute can be deleted, a pattern removed, a maxlength raised, a disabled control enabled, and a hidden field given any value at all. None of this requires unusual skill and all of it takes seconds.
More directly, a request does not have to come from your form. Anyone can send data straight to your endpoint using a command line tool, with whatever values they choose, in whatever combination. Your form is one way to produce a request, not the only way.
What client side validation is actually for
It is a usability feature, and a valuable one. It catches typos immediately, avoids a round trip to the server for an obvious mistake, and gives feedback while the user is still looking at the field.
That is worth doing. It simply has nothing to do with security, and the distinction matters because a form that appears to enforce a rule can create false confidence in the code behind it.
Hidden fields are visible
A hidden input is hidden from view and present in the page source. Its value can be read and changed before submission.
The classic failure is a price or a quantity discount carried in a hidden field and trusted by the server. Prices belong in your database and should be looked up on submission using an identifier, never accepted from the request.
Identifiers in hidden fields deserve the same suspicion. A record id can be changed to any other id, so the server must confirm that the current user is entitled to modify that record rather than assuming the form only offered legitimate options.
Disabled and readonly are not protection
A disabled control is not submitted, and a readonly control is submitted but not editable in the browser. Neither prevents a value being sent, because the request can be constructed by hand.
If a value must not change, do not send it. Look it up on the server from something you already trust, such as the session.
What server side validation must cover
Presence, for every field your logic depends on. Type and format, checked against your own rules rather than assuming the input type constrained anything. Range, for numbers and dates. Length, since a maxlength attribute stops nothing. Permitted values, so a select is checked against the options that were legitimately available. And authorisation, confirming this user may perform this action on this record.
Validate for what you expect rather than trying to catch what you do not want. A list of permitted values is robust, whereas a list of forbidden ones is always incomplete.
Escaping is a separate step
Validation decides whether input is acceptable. Escaping makes it safe in the context where it is used, and the two are not interchangeable.
Text displayed on a page must be escaped for HTML, or a value containing markup becomes part of your document, which is how cross site scripting works. Values used in database queries must go through parameterised statements rather than being concatenated into the query string. Data placed in a URL, an email header or a shell command each needs its own escaping.
The important point is that a value can be perfectly valid and still dangerous. A name legitimately containing an apostrophe will break a concatenated query, so escaping is required regardless of how thorough your validation was.
Cross site request forgery
Even a validated request may not be one the user intended. Another site can cause a visitor's browser to submit a form to yours, carrying their session, without their knowledge.
The standard defence is a token generated per session, included as a hidden field, and verified on submission. It is not confidential, and it works because another site cannot read it to include a matching one. Most frameworks provide this and it should be enabled on every form that changes state.
The rule
Treat every value arriving from a browser as if it were composed by someone trying to break your application, because occasionally it will have been. Validate on arrival, escape on use, and never let a check that ran in the browser stand in for one that should run on your server.