Results for “Types & reliable control flow”
Small, practical examples. Search by task or narrow things down below.
Reset controlled form state
Reset controlled form state with a small React component and explicit browser behavior.
React✓ Tested
Respond while a user types
jQuery: Learn how to respond while a user types in a complete browser example.
jQuery✓ Tested
Restore controls to their initial form defaults
HTML: A reset button restores default values rather than clearing every control.
HTML✓ Tested
Reuse controlled-input bindings
Reuse controlled-input bindings with a small React component and explicit browser behavior.
React✓ Tested
Serialize successful controls for a URL-encoded request
jQuery: serialize includes named enabled controls and checked checkboxes.
jQuery✓ Tested
Set a control value programmatically
Set a control value programmatically with a standalone Angular component and explicit browser behavior.
Angular✓ Tested
Share state between sibling controls
Share state between sibling controls with a small React component and explicit browser behavior.
React✓ Tested
Style a control that fails native validation
CSS: Invalid reflects the input’s current constraint-validation result.
CSS✓ Tested
Subtract durations without underflow
Subtract durations without underflow in a complete Rust program using the standard library.
Rust✓ Tested
Use named states for a controller
Arduino / C: An enum makes state transitions easier to read than unexplained numbers.
Arduino / C✓ Tested
Visually distinguish a disabled control
CSS: The disabled pseudo-class follows the control’s actual disabled state.
CSS✓ Tested
Accept a small behavior interface
Accept a small behavior interface using a complete Go program with explicit sample inputs.
Go✓ Tested