Search code examples
javascripthtmlformssquarespace

How do you create a Squarespace form block in Developer Mode?


Does anyone know how to create a form block in Developer Mode in Squarespace? I want to create a form with a Squarespace id and built in javascript validation and submit behavior but can't use the GUI since I'm in Developer Mode. I haven't been able to find any documentation on it so far. Any help would be appreciatated!


Solution

  • Developer Mode only gives you access to the overall site template itself, but does not give you access to you at the "block level". It does, however, give you access at the "block field level".

    To add a Squarespace Form Block in Developer Mode, you'd add a Squarespace Block Field. Then, you must push your changes to the live site. Having done that, you can log into the live site and add Blocks to the Block Field as needed using the GUI. In your case, that may be adding just a single Form Block.

    The other alternative is, of course, to add your own form code outside of the GUI, using your own HTML, CSS, and JavaScript. I'm guessing that is not what you're looking to do here, though.

    With Block Field IDs, keep in mind that you can assign it a static ID which would allow you to reuse it across any page on the site. Or you can assign it an ID based on the Collection ID, therefore making the Block Field unique on every page that loads the Block Field.