Skip to content

onSubmitDirective(onSubmit: TFormSubmitAction): ReturnType;

return a lit directive that can be used to register a control in a lit render function.

Input parameters

requestOptions

onSubmit function that is called when form pass frontend validation. It receives a submit action object.

Returned value

Lit directive instance.

Example

<form
    id="test-form"
    ${this.formController.onSubmitDirective(({ controlsEntities, formData }) => {
        console.log('submit form', controlsEntities);
    })}>
    <label for="firstname">
        firstname

        <input
            ${this.formController.bindControl()}
            type="text"
            id="firstname"
            name="firstname"
        />
    </label>
</form>