# submitOnChange

> Why JS: a form submits only from a button, so script is what saves a switch the moment it flips; this submits the form whenever one of its controls changes.

```ts
import { submitOnChange } from "@sdxc/ui/app";
```

Applied to any element inside a form: submits that form through `requestSubmit` on every
`change`, so the app's own submit handling (a frame, a fetch) takes the request.

## Signature

```ts
submitOnChange(): MixinDescriptor<HTMLElement>
```

## Examples

```tsx
<span hidden mix={[submitOnChange()]} />
```
