Jump to content

Form value in cookie determines landingpage.

Recommended Posts

Site URL: https://harp-plum-3tmk.squarespace.com/attendance

Dear all,

I'm currently frolicking to create a form in which a check is done to the choices of the visitor which determines on which page you end up.

The idea is that there are 2 questions (can be more) which has to be answered No. If the form contains 1 answer yes you end up being denied.

With JS i want to store the first and last name in a cookie, which i am going to use on the landing page as a thank you message.
Creating a loop to validate the form to check if all radio buttons are checked No.

I have written a small part JS code but i can't figure out how to run the custom JS code before the code that i generated by Squarespace.
The JS code not not complete yet, but if someone has experience and would like to help me i would appreciate it a lot.In a test environment i have setup an example, please let me know if you want to take a look and i will give you access.

Link to comment
  • Replies 5
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Posted Images

Hi there, please grant temp password so I can have a look

Greeting, it's BeyondSpace, I am Squarespace dev focus on provide solutions to enhance feature that squarespace.com can't provide.
Feel free to check my current Squarespace Plugins Developement: Enable Pinch/Zoom on lightbox, Delivery Date Picker, Lightbox Studio plugin
If you find my answer fit your need, let's leave a like or upvote so others with the same issue can find their solution. Thank you

Link to comment
2 hours ago, Lickyshot said:

With JS i want to store the first and last name in a cookie, which i am going to use on the landing page as a thank you message.

The first and last name are considered personally identifiable information (PII), so in the interests of protecting end user privacy, this information should not be stored in a cookie.

About: Squarespace Circle Leader since 2017. I value honesty, transparency, diversity and great design ♥.
Work: Squarespace Developer and founder of SF Digital, building the features Squarespace didn't include™. 
Content: Links in my posts may refer to SF Digital products or may be affiliate links.

Catch up on all the release notes and announcements 2023 [for Circle members only]. There's a public version here too!
If I helped, you can thank me by clicking one of the emojis below. If you prefer, you can buy me a coffee.
Improve your online store with our extensions.

Link to comment
5 minutes ago, paul2009 said:

The first and last name are considered personally identifiable information (PII), so in the interests of protecting end user privacy, this information should not be stored in a cookie.

You are completely right @paul2009 didn't consider that. Thank you for mentioning it.
I wanted to store this information for a followup page that i have in mind.

A little explanation what i have in mind. The data of the form is stored in a Excel in G-Drive.
A followup form will be created which will ask which person(s) you have spoken to that you can fill in later, but have to keep the page open.
With the name stored in a cookie you trace back who filled in the form and to whom they have spoken to. I hope this is not too confusing.

As an alternative i could combine the first and last name and create a unique hash code that is stored. By doing so i can relate both results.

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

×
×
  • Create New...

Squarespace Webinars

Free online sessions where you’ll learn the basics and refine your Squarespace skills.

Hire a Designer

Stand out online with the help of an experienced designer or developer.