Edit this page

API Forms
module up.form

The up.form module helps you work with non-trivial forms.


Guides

Features

Essentials

All features

JS
up.autosubmit(target, [options]) stable

Automatically submits a form when a field changes.

HTML
[up-autosubmit] stable

Automatically submits a form when a field changes.

HTML
[up-fieldset] deprecated

Marks this element as a from group, which (usually) contains a label, input and error message.

JS
up.form.config stable

Sets default options for form submission and validation.

JS
up.form.fields(root) experimental

Returns a list of form fields within the given element.

JS
up.form.group(element) experimental

Returns the form group for the given element.

HTML
[up-form-group] stable

Marks this element as a from group, which (usually) contains a label, input and error message.

JS
up.form.isField(element) stable

Returns whether the given element is a form field, such as input or select.

JS
up.form.isSubmittable(form) stable

Returns whether the given form will be submitted through Unpoly instead of making a full page load.

JS
up:form:submit stable

This event is emitted when a form is submitted through Unpoly.

JS
up.form.submitButtons(root) experimental

Returns a list of submit buttons within the given element.

JS
up.form.submitOptions(form, [options]) stable

Parses the render options that would be used to submit the given form, but does not render.

JS
up:form:validate stable

This event is emitted before a form is being validated.

HTML
[up-hide-for] stable

Hides this element if an input field with [up-switch] has one of the given values.

HTML
[up-observe] deprecated

Watches form fields and runs a callback when a value changes.

JS
up.observe(elements, [options], onChange) deprecated

Observes form fields and runs a callback when a value changes.

HTML
[up-show-for] stable

Only shows this element if an input field with [up-switch] has one of the given values.

JS
up.submit(form, [options]) stable

Submits a form via AJAX and updates a page fragment with the response.

HTML
[up-submit] stable

Submits this form via JavaScript and updates a fragment with the server response.

HTML
[up-switch] stable

Show or hide elements when a form field is set to a given value.

JS
up.validate(element, [options]) stable

Render a new form state from its current field values, to show validation errors or update dependent fields.

HTML
[up-validate] stable

Renders a new form state when a field changes, to show validation errors or update dependent fields.

JS
up.watch(element, [options], callback) stable

Watches form fields and runs a callback when a value changes.

HTML
[up-watch] stable

Watches form fields and runs a callback when a value changes.