After submitting a form, the user is taken to a thank you page. On this page I create a variable containing the url to a specific floor plan they selected from the form.
$floorplan = $_POST['cm-f-djuiyhkr'];
I then want to open this floorplan pdf in a new tab after the thank you page has loaded. Currently this is what I have at the bottom of my document
<script>
$(document).ready(function(){
window.setTimeout(function(){
var link = '<?php echo $floorplan ?>';
var newTab = window.open(link, '_blank');
}, 5000);
});
}
</script>
Obviously it's not working, and I am not good enough with code to debug it. I assume it is trouble mixing JS and PHP