This event is emitted when a form is submitted through Unpoly.
When the form is being validated, this event is not emitted.
Instead an up:form:validate
event is emitted.
Listeners may inspect and manipulate render options for the coming fragment update.
The code below will use a custom transition when a form submission fails:
up.on('up:form:submit', function(event) {
event.renderOptions.failTransition = 'shake'
})
The element that caused the form submission.
This is usually a submit button or a focused field. If the element is not known, the event is emitted
on the <form>
element.
The form that is being submitted.
The form parameters that will be send as the form's request payload.
Listeners may inspect and modify params before they are sent.
The button used to submit the form.
If no button was pressed directly (e.g. the user pressed Enter
inside a focused text field),
this returns the first submit button.
An object with render options for the fragment update.
Listeners may inspect and modify these options.
Prevents the form from being submitted.