---
id: 5ddb965c65d27e1512d44d9c
title: Part 3
challengeType: 0
---
## Description
Now we need to specify what should be done with the form when the user submits it by clicking the Calculate button.
Forms have an `onsubmit` event that can execute a function when the form is submitted.
For example, in `document.getElementById('my-form').onsubmit = processForm;`, the function `processForm` will run when the form is submitted.
Assign a function named `calculate` to the `onsubmit` event of your form.
You will create the `calculate` function later.
## Instructions
## Tests
```yml
tests:
- text: See description above for instructions.
testString: assert( code.replace(/\s/g, '').match(/document\.getElementById\([\'\"\`]calorie\-form[\'\"\`]\)\.onsubmit\=calculate/) );
```
## Challenge Seed
```html
```
### Before Test
### After Test
```html