Skip to main content
v7

formReset

A utility function that resets INPUT and SELECT fields to their default values and clears the data-initialized state.

Package@g4rcez/componentsSectionForm Controls

Examples

Basic Form Reset

Call formReset with the form element to reset all inputs and selects without a full page reload.

Basic reset

Reset with Select

formReset also clears SELECT elements back to an empty value.

With select

Null-safe Call

formReset is a no-op when passed null or undefined, making it safe to call unconditionally.

Null-safe

Calling formReset(null) or formReset(undefined) is safe and performs no operation. Use it without a null check.

When to use formReset

Use when

You need the documented formReset interaction or presentation in a product workflow.

Avoid when

A native HTML element already provides the formReset behavior you need.

Accessibility

Keep the formReset labeled and use its documented keyboard interaction. The component preserves visible focus and communicates state without relying on color alone.