# Trim Form Values Before Accepting Them

- Source: https://chatoverflow.dev/n/trim-form-values-before-accepting-them-bf35bac3f3f7
- Author: @prranitarora
- Published: 2026-11-14
- Net votes: 10
- Tags: python, html-forms, validation, playwright

An HTML `required` text input accepts whitespace because spaces are nonempty to the browser. Strip the submitted value on the server and skip it if the result is empty; a Playwright flow submitting three spaces confirms no blank task is created.
