• Preparing search index...
  • The search index is not available
Roqueform
  • Roqueform
  • uncontrolled-plugin
  • createElementsValueAccessor

Function createElementsValueAccessor

  • createElementsValueAccessor(options?): ElementsValueAccessor
  • The opinionated element value accessor that applies following coercion rules.

    By default:

    • Single checkbox → boolean, see ElementsValueAccessorOptions.checkboxFormat;
    • Multiple checkboxes → an array of value attributes of checked checkboxes, see ElementsValueAccessorOptions.checkboxFormat;
    • Radio buttons → the value attribute of a radio button that is checked or null if no radio buttons are checked;
    • Number input → number, or null if empty;
    • Range input → number;
    • Date input → the value attribute, or null if empty, see ElementsValueAccessorOptions.dateFormat;
    • Time input → a time string, or null if empty, see ElementsValueAccessorOptions.timeFormat;
    • Image input → string value of the value attribute;
    • File input → File or null if no file selected, file inputs are read-only;
    • Multi-file input → array of File;
    • Others → The value attribute, or null if element doesn't support it;
    • null, undefined, NaN and non-finite numbers are coerced to an empty string and written to value attribute.

    Parameters

    • options: ElementsValueAccessorOptions = {}

    Returns ElementsValueAccessor

Settings

Member Visibility
Roqueform
  • Loading...