# Running forms using JavaScript

> You can execute JavaScript while a form is displaying, using the [Run Form Script](https://docs.uipath.com/activities/other/latest/workflow/execute-script-activity) activity. This tutorial demonstrates how to display a simple JavaScript alert while a form is showing.
:::note
To help you achieve your use case with JavaScript, don't forget to inspect the form elements at runtime using **DevTools**. To open **DevTools** on a form, right-click inside the body of the form while it's showing, and click Inspect.
:::

You can execute JavaScript while a form is displaying, using the [Run Form Script](https://docs.uipath.com/activities/other/latest/workflow/execute-script-activity) activity. This tutorial demonstrates how to display a simple JavaScript alert while a form is showing.
:::note
To help you achieve your use case with JavaScript, don't forget to inspect the form elements at runtime using **DevTools**. To open **DevTools** on a form, right-click inside the body of the form while it's showing, and click Inspect.
:::

1. Create a **Form** file on top of which you want to execute JavaScript.
2. Add a **Show Form** activity and select the form that you created at step 1, and make sure that Continue Workflow Execution is enabled.
3. Add a [Run Form Script](https://docs.uipath.com/activities/other/latest/workflow/execute-script-activity) activity and select the form that you created at step 1.
4. Inside the Source property field, add the JavaScript between double quotes `" "`.

   For this example, use the following JavaScript to show an alert on top of the form:

   ```
   "alert('You can now close the form!')"
   ```
5. Run the workflow to display the form. Right-click inside the body of the form at runtime, and then click Inspect.

**DevTools** opens and you can inspect your custom JavaScript to debug it.
   
   ![docs image](https://dev-assets.cms.uipath.com/assets/images/activities/activities-docs-image-215746-2998bee0.webp)
   
   ![docs image](https://dev-assets.cms.uipath.com/assets/images/activities/activities-docs-image-215741-d55bfdd8.webp)

## Workflow example

To follow the steps and try out the tutorial yourself, see [this sample project](https://documentationexamplerepo.blob.core.windows.net/examples/Forms/Running_forms_with_JS_sample.zip).
