Skip to main content
Solved

Can you fire custom JS on a form submit?

  • July 15, 2022
  • 2 replies
  • 1009 views

Forum|alt.badge.img+3

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!

Best answer by stephen.trumble

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!

This topic has been closed for replies.

2 replies

stephen.trumble
Forum|alt.badge.img+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!


Forum|alt.badge.img+3
  • Author
  • Active Contributor I
  • July 15, 2022

Thanks @stephen.trumble that’s super helpful!