# Popup: Control widget behavior after the form is submitted via Custom JS

**URL:** <https://community.elfsight.com/t/popup-control-widget-behavior-after-the-form-is-submitted-via-custom-js/42487>\
**Category:** New Feature\
**Tags:** popup\
**Created:** [February 28, 2024, 4:43pm UTC](https://community.elfsight.com/t/popup-control-widget-behavior-after-the-form-is-submitted-via-custom-js/42487 "2024-02-28T16:43:29Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Max](https://sea2.discourse-cdn.com/flex020/user_avatar/community.elfsight.com/max/32/710_2.png) [@Max](https://community.elfsight.com/u/Max)\
**Post date:** [February 28, 2024, 4:43pm UTC](https://community.elfsight.com/t/popup-control-widget-behavior-after-the-form-is-submitted-via-custom-js/42487/1 "2024-02-28T16:43:29Z")

</div>

We’ve added a `submit` event for the `form` service in our [Popup](https://elfsight.com/popup-widget/) app. This event is helpful if you want to set the certain behavior of the widget with the JS code after the form is successfully submitted.

With this event, you can tweak your widget however you like. Here are some examples:

- Change background color of the Success Message

- Send events to GTM

- Show banner with the Success message after the form was sent

- And more!

  

Guys, if you faced difficulties or have questions about using this functionality, don’t hesitate to let us know. We are always here to help 🙂
