# Extending form JavaScript

**URL:** <https://forum.mautic.org/t/extending-form-javascript/18110>\
**Category:** Development\
**Tags:** development\
**Created:** [February 10, 2021, 12:12pm UTC](https://forum.mautic.org/t/extending-form-javascript/18110 "2021-02-10T12:12:18Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![a.bell](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/a.bell/32/2264_2.png) [@a.bell](https://forum.mautic.org/u/a.bell)\
**Post date:** [February 10, 2021, 12:12pm UTC](https://forum.mautic.org/t/extending-form-javascript/18110/1 "2021-02-10T12:12:18Z")

</div>

Does anyone know if it’s possible to add to or customise JavaScript which runs when a form is submitted, preferably via a plugin or a theme?

I’m not trying to make any big changes, just add / remove css classes once a form has been submitted, and once the response comes back from the server to display the confirmation message.

Example - forms loaded on a website via the automatic script tag

```
<script type="text/javascript" src="//[SITE_URL]/form/generate.js?id=[FORM_ID]"></script>

```

Form loads - add css class to form  
Form submitted - add / remove css classes  
Form confirmation/server response - add / remove css classes

Any advice would be appreciated.

Many Thanks  
Andy
