# ui/bindings/submithandler

module

<a id="type-definitions">

## Type Definitions

<a id="typedef-SubmitHandlerEvent">

### `SubmitHandlerEvent`

<a id="functions">

## Functions

<a id="function-submitHandler">

### `submitHandler( options = { options.view } ) → void`

A handler useful for [views](module_ui_view-View.md) working as HTML forms. It intercepts a native DOM `submit` event, prevents the default web browser behavior (navigation and page reload) and fires the `submit` event on a view instead. Such a custom event can be then used by any [emitter](module_utils_dom_emittermixin-DomEmitter.md), e.g. to serialize the form data.

```typescript
import { submitHandler } from '@ckeditor/ckeditor5-ui/src/bindings/submithandler';

// ...

class AnyFormView extends View {
	constructor() {
		super();

		// ...

		submitHandler( {
			view: this
		} );
	}
}

// ...

const view = new AnyFormView();

// A sample listener attached by an emitter working with the view.
this.listenTo( view, 'submit', () => {
	saveTheFormData();
	hideTheForm();
} );
```

[See source](https://github.com/ckeditor/ckeditor5/blob/master/packages/ckeditor5-ui/src/bindings/submithandler.ts#L49)

#### Parameters

* `options: object`

  Configuration options.

  Properties

  * `options.view: View`

    The view which DOM `submit` events should be handled.

#### Returns

* `void`

---

Full index of the CKEditor 5 API reference: [llms.txt](llms.txt)
