-
Content Count
74 -
Joined
-
Last visited
-
Days Won
1
summitdigitaluk last won the day on July 12 2016
summitdigitaluk had the most liked content!
Personal Information
- Website
-
Location
Winchester, United Kingdom
Recent Profile Visitors
336 profile views
-
JamesonW reacted to an answer to a question: Custom form validation (intercepting the form submission)
-
Custom form validation (intercepting the form submission)
summitdigitaluk replied to summitdigitaluk's question in Coding and Customization
Hi Rodrigo, My example refers to a Form Block. When you are editing the page you can find the data-form-id attribute by inspecting the code and looking for the correct form element. It can be a bit tricky whilst editing the page because there are extra elements laying over the top of all the blocks on the page which Squarespace use to show the edit buttons etc... If you inspect the page outside of the editor, it is a bit easier to find: These examples are from 2 different websites incase you were wondering why the ID is different! I hope this helps. -
pigeon8 reacted to a question: Custom form validation (intercepting the form submission)
-
jasonconway started following summitdigitaluk
-
summitdigitaluk started following Custom form validation (intercepting the form submission)
-
michaeleparkour reacted to an answer to a question: Custom form validation (intercepting the form submission)
-
Custom form validation (intercepting the form submission)
summitdigitaluk replied to summitdigitaluk's question in Coding and Customization
Hi @Tom_Warfield. This does not require Developer Mode, but you may need to upgrade your plan to enable Code Injection. A basic example would be like this: <script> //Specific form button to disable/re-enable const buttonToDisable = document.querySelector('[data-form-id="5ecfda33f13530766af10f1d"] input[type="submit"]'); //Add 'disabled' attribute to the form button buttonToDisable.disabled = true; //Specific form input which needs custom validation let inputToValidate = document.querySelectorAll('[data-form-id="5ecfda33f13530766af10f1d"] input.text')[0]; -
summitdigitaluk reacted to an answer to a question: Unable to start local development server
-
Unable to start local development server
summitdigitaluk replied to Ima's question in Coding and Customization
Hi @Ima, I was having the same issue. I submitted a ticket to Squarespace and they identified that there was an issue with their code. It has now been resolved. To get your site back up and running you should just need to update your local Squarespace Server by opening a new terminal and running this command: npm install -g @squarespace/server You should now be on version 1.6.2. When you load up your site, you might need to refresh the content cached by adding the query ?nocache=true to the end of localhost:9000; like this: http://localhost:9000/?nocache=true That will -
Custom form validation (intercepting the form submission)
summitdigitaluk replied to summitdigitaluk's question in Coding and Customization
@michaeleparkour You are a genius. Such a simple solution! I was totally over-complicating it in my head. -
Has anybody had any experience with adding their own validation to a Squarespace form? Essentially stopping the normal submission process, checking some custom validation, then continuing as normal/stopping the submission if there was an invalid entry? I have a client that needs some number fields to be submitted within a specific range and a few other variations on this theme. I'm hoping to find a simple solution, but I'm also happy to go with a very complicated one 😆 @michaeleparkour Do any of your plugins do this, or perhaps this is something you have come up against?