I have created a custom event form
but it’s not working on button click here is the code
document.addEventListener("DOMContentLoaded", function(event) {
$(".klaviyo_submit").click(function() {
var _learnq = _learnq || [];
_learnq.push(['track', 'Send Postcard from website', {
'to_email': $('#postcard_email').val(),
'to_name': $('#postcard_to_name').val() + " " + $('#postcard_to_last_name').val(),
'from_email': $('#postcard_from_email').val(),
'from_name': $('#postcard_img_from_first_name').val(),
'from_first_name': $('#postcard_img_from_last_name').val(),
'image_url': $('#postcard_img').val(),
'caption': $('.postcard-section .postcard-content-title-caption p').text(),
'message': $('#postcard_msg').val(),
'first_name_upper': $('#postcard_to_name').val().toUpperCase(),
'from_name_upper': $('#postcard_img_from_first_name').val().toUpperCase() + " " + $('#postcard_img_from_last_name').val().toUpperCase(),
'postcard_number': $('.postcard-content-number').text().replace('\n< Nº ', '').replace(' >\n', ''),
'first_name': $('#postcard_to_name').val(),
'title': $('#postcard_title').val(),
'from_first_name_upper': $('#postcard_img_from_first_name').val().toUpperCase()
}]);
});
});
Here is the link of form, click on send postcard
https://www.smrdays.com/blogs/postcards/theodoros-zeta-montpellier-france