Edit this page

up.form up.autosubmit(target, [options])
JavaScript function

Automatically submits a form when a field changes.

The unobtrusive variant of this is the [up-autosubmit] attribute.


Parameters

target string|Element|jQuery

The field or form to watch.

[options.event='change'] string|Array<string> optional

The event types to observe.

See which events to watch.

[options.delay] number optional

The number of milliseconds to wait between an observed event and validating.

See debouncing callbacks.

[options.disable] boolean|string|Element|Array optional

Disables fields while waiting for the server response.

See disabling fields while working.

[options.placeholder] string|Element|List<Node> optional experimental

A placeholder to show within the targeted fragment while it is loading.

See showing loading state while working.

[options.preview] string|Function(up.Preview)|Array optional

One or more previews that temporarily change the page while the targeted fragment is loading.

See showing loading state while working.

[options.feedback=true] boolean optional

Whether to show feedback classes while waiting for the server response.

[options] Object optional

Additional render options to use when the form is submitted.

See options for up.submit().

Return value

Function()

A destructor function that stops auto-submitting when called.

Auto-submitting will stop automatically when the observed fields are removed from the DOM.