# Functions & Events

**URL:** <https://www.five.org/t/functions-events/153>\
**Category:** How do I?\
**Created:** [January 19, 2023, 3:55am UTC](https://www.five.org/t/functions-events/153 "2023-01-19T03:55:29Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![TheMaskedDev](https://yyz2.discourse-cdn.com/flex030/user_avatar/www.five.org/themaskeddev/32/40_2.png) [@TheMaskedDev](https://www.five.org/u/TheMaskedDev)\
**Post date:** [January 19, 2023, 3:55am UTC](https://www.five.org/t/functions-events/153/1 "2023-01-19T03:55:29Z")

</div>

Hi,

could someone explain functions and events to me please? For example, can I run a hand-coded JS function when someone exits a form field in my app?

Cheers

---

<div class="post-metadata">

**Author:** ![Jo-Anne](https://yyz2.discourse-cdn.com/flex030/user_avatar/www.five.org/jo-anne/32/45_2.png) [@Jo-Anne](https://www.five.org/u/Jo-Anne)\
**Post date:** [January 19, 2023, 4:42am UTC](https://www.five.org/t/functions-events/153/2 "2023-01-19T04:42:24Z")

</div>

Hi The MaskedDev,

Yes you can! The short video below demonstrates how you can write your code in Five’s Code Editor and attach this function to an event in Five. For your particular scenario, you would need to navigate to the Form Field record and add it to the On Exit event.

[![](https://canada1.discourse-cdn.com/flex030/uploads/five/original/1X/52cd70c0a834318233fe555a58fcc6ba4db3be3d.jpeg "Add a Function and Attach it to an Event in Five | Low-Code For Real Developers | Five.Co") ](https://www.youtube.com/watch?v=RQbT_eP6fq4)
