I’m a designer with limited code knowledge. I have a specific request to create a process whereby a Webinars page is accessed only once an email form has been submitted.
Currently, my plan for the user journey is:
Click ‘Webinars’ page link from nav bar
This takes you to a page (/Webinars-sign-up) with an email submission form and a full screen div that is blurring out the webinars page content
On form submission, it redirects to the real Webinars page (/Webinars)
I want to find a way to do this where the user doesn’t have to fill out this form every time they come back to the page. Therefore, if a user has already submitted the form in step 2, they can skip straight to the Webinars page.
I’m really just looking for general help, thoughts and ideas on how I can make this dream a reality in the most simple way possible, as I have very little code understanding beyond basic html/css.
Just to update this post, I found a few pieces of code (one to check for cookies and one to complete an action on form submit) that I merged into this:
Hey Molly, can’t guarantee this will work instantly but I made some edits to your code. You can try it on your site to validate if it works.
<script>
var cookieName = 'webinarsSubmit';
if(typeof Cookies.get(cookieName) !== 'undefined') {
window.location.replace("http://yoursite.com/webinar"); //Edited this to redirect if cookie is found
}
$('.webinarsForm').submit()=>{ //Edited this line because there was extra '('
Cookies.set(cookieName, 'ok', { expires: 365 });
alert('Cookie set', Cookies.get('cookieName')) // Just to check if your code works. You can remove this later. Shows an alert when webinarform is submitted.
})
</script>