FIND YOUR NEXT FEW LINES

The snippet library.

Small, practical examples. Search by task or narrow things down below.

10 snippets foundClear filters
HTMLForm behavior

Associate a control outside the form element

HTML: The form attribute links an external named control to the form’s ID.

HTML✓ Tested
HTMLForm behavior

Choose a local file through a labeled control

HTML: A file input exposes selected file metadata to the page without providing arbitrary filesystem access.

HTML✓ Tested
HTMLForm behavior

Collect several checked values under one name

HTML: Only checked named checkboxes become successful form controls.

HTML✓ Tested
HTMLForm behavior

Disable a related group of controls

HTML: A disabled fieldset prevents editing its descendant controls and omits them from form submission.

HTML✓ Tested
HTMLForm behavior

Identify the selected submit action

HTML: Each submit button can supply its own named value for the same form.

HTML✓ Tested
HTMLForm behavior

Include a nonvisible value in form data

HTML: A named hidden input contributes data without adding a visible editing control.

HTML✓ Tested
HTMLForm behavior

Keep an action button from submitting a form

HTML: Specify type button for controls whose purpose is a local action.

HTML✓ Tested
HTMLForm behavior

Make an unavailable select option unselectable

HTML: A disabled option remains visible but cannot be selected through normal keyboard navigation.

HTML✓ Tested
HTMLForm behavior

Restore controls to their initial form defaults

HTML: A reset button restores default values rather than clearing every control.

HTML✓ Tested
HTMLForm behavior

Submit a readonly value while preventing edits

HTML: Readonly controls remain in form data, unlike disabled controls.

HTML✓ Tested