liveBook · Manning

Browser validation

As explained in Rust Servers, Services, and Apps

In-browser validation is client-side checking of form input performed by a web browser before submission.

Browser validation checks form input before submission using validation behavior defined by the HTML specification, without custom code. section 8.3

A registration form can enable browser validation with:

  • required fields, which prompt users when left empty. section 8.3
  • minlength and maxlength constraints, which reject input outside the specified limits. section 8.3

Tutor registration

Clicking Register with empty required fields or invalid string lengths displays a browser-generated message. Matching the password and confirmation fields requires server-side validation in the Actix handler, which can return the form with an error and preserve entered values. section 8.3

How Rust Servers, Services, and Apps covers it

How deep it goes
Demonstrates native required, minlength, and maxlength checks, then stops short of implementing complex client-side rules.
Examples
Uses empty registration fields, length violations, and mismatched password confirmation as validation examples.
What it assumes
Assumes an HTML registration form and distinguishes native checks from custom server-side validation.
What you can do after
Apply it via HTML form constraints, while implementing cross-field rules such as password confirmation on the server.
How it connects
Connects HTML forms with server-side validation and JavaScript-based validation alternatives.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Rust Servers, Services, and Apps. The section links point to the parts of the book it draws on.