Forward to multiple pages
-
Hello,
I have several forms on my website and they each forward to a different page on completion.
I am updating the site to use the dom event and for the page above this works fine –
add_action( ‘wp_footer’, ‘mycustom_wp_footer’ );
function mycustom_wp_footer() {
?>
<script type=”text/javascript”>
document.addEventListener( ‘wpcf7mailsent’, function( event ) {
if ( ‘3562’ == event.detail.contactFormId ) {
location = ‘https://orkneyathleticclub.co.uk/payment-page-oac-10k-series-2018/’;
}
}, false );
</script>
<?php
}I thought that for the other pages/forms I could just add a series of else if statements e.g.
add_action( ‘wp_footer’, ‘mycustom_wp_footer’ );
function mycustom_wp_footer() {
?>
<script type=”text/javascript”>
document.addEventListener( ‘wpcf7mailsent’, function( event ) {
if ( ‘3562’ == event.detail.contactFormId ) {
location = ‘https://orkneyathleticclub.co.uk/payment-page-oac-10k-series-2018/’;
else if ( ‘2975’ == event.detail.contactFormId ) {
location = ‘https://orkneyathleticclub.co.uk/another-page/’;}
}, false );
</script>
<?php
}But when I do the above neither form forwards anymore.
Please could you advise.
Many Thanks
Phill
The page I need help with: [log in to see the link]
- The topic ‘Forward to multiple pages’ is closed to new replies.