Edit this page

up.form up.form.config
JavaScript property

Sets default options for form submission and validation.

Value

[config.observeDelay=0] number optional

The number of miliseconds to wait before up.observe() runs the callback after the input value changes. Use this to limit how often the callback will be invoked for a fast typist.

[config.submitSelectors] Array<string> optional

An array of CSS selectors matching forms that will be submitted through Unpoly.

You can configure Unpoly to handle all forms on a page without requiring an [up-submit] attribute:

up.form.config.submitSelectors.push('form')

Individual forms may opt out with an [up-submit=false] attribute. You may configure additional exceptions in config.noSubmitSelectors.

[config.noSubmitSelectors] Array<string> optional

Exceptions to config.submitSelectors.

Matching forms will not be submitted through Unpoly, even if they match config.submitSelectors.

[config.validateTargets=['[up-fieldset]:has(&)', 'fieldset:has(&)', 'label:has(&)', 'form:has(&)']] Array<string> optional

An array of CSS selectors that are searched around a form field that wants to validate.

The first matching selector will be updated with the validation messages from the server.

By default this looks for a <fieldset>, <label> or <form> around the validating input field.

[config.fieldSelectors] string optional

An array of CSS selectors that represent form fields, such as input or select.

[config.submitButtonSelectors] string optional

An array of CSS selectors that represent submit buttons, such as input[type=submit].

This website uses cookies to improve usability and analyze traffic.
I accept or learn more