Results for “Forms & validation”
Small, practical examples. Search by task or narrow things down below.
Validate an entire identifier
Python: Use fullmatch so a regex must consume the complete input.
Python✓ Tested
Validate an unknown value with a type guard
Check a field before treating unknown data as a typed object.
unknown✓ Tested
Validate email syntax with Angular’s email validator
Validate email syntax with Angular’s email validator with a standalone Angular component and explicit browser behavior.
Angular✓ Tested
Validate UTF-8 bytes
Validate UTF-8 bytes using a complete Go program with explicit sample inputs.
Go✓ Tested
Wrap an error with context
Wrap an error with context using a complete Go program with explicit sample inputs.
Go✓ Tested
Add a multiline text field
Set a maximum length and visible rows on a labeled HTML textarea.
HTML✓ Tested
Associate a label with an input
Give an HTML text input an accessible name using for and id.
HTML✓ Tested
Convert a variable to uppercase
Bash Scripts: Double caret transforms matching lowercase characters in Bash 4 or later.
Bash Scripts✓ Tested
Copy selected rows into another table
SQL: INSERT SELECT performs a set-based copy with an explicit destination column list.
SQL✓ Tested
Copy selected rows into another table
SQL Server: INSERT SELECT performs a set-based copy with an explicit destination column list.
SQL Server✓ Tested
Copy selected rows into another table
Postgres: INSERT SELECT performs a set-based copy with an explicit destination column list.
Postgres✓ Tested
Copy selected rows into another table
SQLite: INSERT SELECT performs a set-based copy with an explicit destination column list.
SQLite✓ Tested