Solved

i am developer i use klaviyo form with lagecy mode now i want to show new custom html popup after form submit

  • 22 January 2021
  • 2 replies
  • 583 views

Badge +3

i integrate klaviyo on shopify theme with legacy mode.

form working now 

now i want show the custom html popup when form submits successfully  

icon

Best answer by retention 25 January 2021, 21:30

View original

2 replies

Userlevel 7
Badge +57

@sanjay_ - The Legacy Form generates a Javascript success callback that you can execute Javascript to handle upon a successful form submit. 

Using the example from Klaviyo’s documentation, on the success callback, this example pushes the “identify” function to Klaviyo based on the email that was submitted.

<script type="text/javascript">
KlaviyoSubscribe.attachToForms('#email_signup', {
...
success: function ($form) {
// `$form` is a jQuery wrapper around the form that was submitted. This makes it easy to get the email address or form fields.
var email = $form.find('[name="email"]').val();
_learnq.push(['identify', { $email: email }]);
_learnq.push(['track', 'Signed Up for Newsletter']);
}
...
});
</script>

In the similar method, you can also create your own function that can Show/Unhide an HTML Popup on the success callback.


Some more details of Legacy Form options here:
How to Add and Customize a Legacy Embedded Signup Form

Userlevel 5
Badge +8

Hi @sanjay_,

Wanted to check in on this -- were you able to give @retention’s suggestion a try? Happy to answer any followup questions you might have!

Best,

Caroline

Reply