Solved

Can you fire custom JS on a form submit?

  • 15 July 2022
  • 2 replies
  • 517 views

Badge +2

Does anyone know if it’s possible to wire the signup form’s submit button to also fire some custom JS?  

 

In a nutshell, I basically want to fire client side JS function as soon as the user submits the form so I can store some data in their session.

 

Any help would be greatly appreciated.  Thanks!

icon

Best answer by stephen.trumble 15 July 2022, 18:17

View original

2 replies

Userlevel 7
Badge +60

Hey @SharonSTP 

Thank you so much for asking the Klaviyo Community for help!

There is a track API snippet that you can add to your site. It is documented in our Adding Custom JavaScript Events to Forms guide. Hope this helps!

Badge +2

Thanks @stephen.trumble that’s super helpful!

Reply