# Events

<PageBadges />

import { Badge } from "zudoku/ui/Badge"

Events live in `form.events.code` and are evaluated at runtime. Use `ON` to register handlers
and `SETVALUE`/`ALERT` to interact with the form.

## Quick example

```js
ON("change", "age", function (event) {
  if ($age >= 18) {
    SETVALUE("can_vote", "yes")
  }
})
```

## Event builtins

### <Badge variant="secondary">Events</Badge>

- [`ON`](/core/builtins/events/on)
- [`OFF`](/core/builtins/events/off)
- [`ALERT`](/core/builtins/events/alert)
- [`SETVALUE`](/core/builtins/events/setvalue)

Event handlers can also use the calculation builtins listed in
[Calculations & expressions](/core/builtins/calculations-expressions-overview).
