Results for “Forms & validation”
Small, practical examples. Search by task or narrow things down below.
Group mutually exclusive choices
Use the same name for HTML radio buttons and a fieldset legend.
HTML✓ Tested
Increment a shared counter atomically
C#: Interlocked performs an indivisible update without a separate lock for this operation.
C#✓ Tested
Limit a numeric input to an inclusive range
HTML: Number inputs expose range validation separately from the entered text.
HTML✓ Tested
Limit typed text to a maximum length
HTML: Maxlength limits ordinary user editing without replacing server-side validation.
HTML✓ Tested
Move a box visually without changing its layout slot
CSS: Transforms change the painted geometry while leaving surrounding normal-flow layout unchanged.
CSS✓ Tested
Offer a selection list
Provide a labeled HTML select with a default option.
HTML✓ Tested
Raise and catch a domain-specific exception
Python: Give a validation failure its own exception type so callers can handle it narrowly.
Python✓ Tested
Read a variable whose name is stored in another variable
Bash Scripts: Indirect expansion performs one extra variable-name lookup.
Bash Scripts✓ Tested
Replace a literal substring
SQL: REPLACE performs a literal replacement rather than a regular-expression substitution.
SQL✓ Tested
Replace a literal substring
SQL Server: REPLACE performs a literal replacement rather than a regular-expression substitution.
SQL Server✓ Tested
Replace a literal substring
Postgres: REPLACE performs a literal replacement rather than a regular-expression substitution.
Postgres✓ Tested
Replace a literal substring
SQLite: REPLACE performs a literal replacement rather than a regular-expression substitution.
SQLite✓ Tested