Form: Features
Submit & Reset
To submit a form, use a regular button (or LionButton
) with type="submit"
(which is default) somewhere inside the native <form>
.
Then, add a submit
handler on the lion-form
.
You can use this event to do your own (pre-)submit logic, like getting the serialized form data and sending it to a backend API.
Another example is checking if the form has errors, and focusing the first field with an error.
To fire a submit from JavaScript, select the lion-form
element and call .submit()
.