Submits this form via JavaScript and updates a fragment with the server response.
The server must render an element matching the target selector from the [up-target]
attribute.
A matching element in the current page is then swapped with the new element from the server response.
The response may include other HTML (even an entire HTML document), but only the matching element will be updated.
The programmatic variant of this is the up.submit()
function.
<form method="post" action="/users" up-submit up-target=".content">
...
</form>
When the form could not be submitted due to invalid user input, Unpoly can re-render the form with validation errors.
See validating forms for details and examples.
See navigation feedback and disabling form controls while working.
You may omit the [up-submit]
attribute if the form has one of the following attributes:
[up-target]
[up-layer]
[up-transition]
Such a form will still be submitted through Unpoly.
You can configure Unpoly to handle all forms on a page without requiring an [up-submit]
attribute.
Info
All attributes for
[up-follow]
may be used.
The target selector to update for a successful form submission.
The target selector to update when the server responds with an error code.
Defaults to the form element itself.
Whether to disable form controls while the form is submitting.