When you embed a Youform on your page and it has been submitted then we trigger an event named to the parent page.
You can listen to that to event to do anything like hiding the form, redirecting etc.
Here is a sample code for how to listen to that message and then perform an action on your page:
<script>
window.addEventListener('message', function(event) {
if (event.data && event.data == 'youformComplete') {
document.getElementById('success').style.display = 'block';
}
});
</script>
Here's a sample page which embeds Youform and then shows a message on parent page when the form has been submitted: https://uform.site