Skip to content
Back to skills

Forms And Validation

ASecurity

Build forms with one validation schema shared by client and server, accessible errors and safe submission

  • 7 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added November 30, 2026
ai-agentsrustapifrontendbackend

Works with

  • cli
  • api

Security analysis

A100/100

Scanned November 30, 2026

npx -y skills add ansh44233/forge --skill forms-and-validation --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Forms And Validation?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Forms And Validation
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/ansh44233-forms-and-validation/badge)](https://www.skillsdirectory.com/skills/ansh44233-forms-and-validation)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
description: Build forms with one validation schema shared by client and server, accessible errors and safe submission
profile: standard
tags: forms, validation, frontend, backend
---

# Forms and validation

Validation on the client is for UX; validation on the server is for correctness. Do both from one schema when the stack allows.

## Schema
- One schema (zod, valibot, yup, pydantic, JSON Schema) defines types, constraints and messages; reuse it on both sides.
- Server rejects invalid input with field-level errors in a consistent shape.

## UX and accessibility
- Every input has a `<label>`; errors are linked with `aria-describedby` and announced.
- Validate on blur and submit, not on every keystroke; keep user input after an error.
- Disable the submit button while pending and prevent double submission.

## Safety
- Never trust hidden fields or client-computed prices/permissions.
- CSRF protection on cookie-authenticated forms.

## Verify
Submit the form with invalid data from the UI and directly against the API (curl or a test): both are rejected with field errors; a valid submit succeeds once even when clicked twice.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.