i'm trying to submit a contactform 7 form on safari but it doesn't work because of event.preventDefault(). In all other browsers it is working, like it should. After submit the api should get a post with serialized data. can't find a solution for this, hope you can help me out on this.
<div class="formular">
<?php echo do_shortcode( '[contact-form-7 id="1234"]' ); ?>
</div>
$(".formular form").submit(function(event){
event.preventDefault();
var formValues = $(this).serialize();
});
<script type="text/javascript">
document.addEventListener( 'wpcf7mailsent', function( event ) {
if ( '1234' == event.detail.contactFormId ) {
var formValues = $('.formular form').serialize();
$.post("https://api", formValues, function(data){
});
}
}, false );
</script>