Design + Coding > Forms code implemented on HTML page
Hold, I am trying something different.
I figured it out. Note I have only tried this with the standard contact form.
Here is how to add a SS form to an HTML page
Create a form and enable it, if you don't want it to show up in your navigation, create a hidden section and put it there.
In the HTML page add this to the top of the HTML box (in raw mode)
<script type="text/javascript" src="/universal/yui/yahoo-dom-event/yahoo-get-dragdrop-connection.js?CE=16"></script>
<script type="text/javascript" src="/universal/scripts/form-builder.js?CE=16"></script>
Navigate to your active form and view source.
Look for <div id="content"> and </div></div> <!-- Content -->
Copy and paste everything between (not including) <div id="content"> and </div></div> <!-- Content -->
Mine looks like this: (The X's will be what SS sets as your unique page/form ID.
<script>
var theFormXXXXXXX;
YAHOO.util.Event.onDOMReady(function() {
theFormXXXXXXX = new Squarespace.FormBuilder( "theFormXXXXXXX", "formOuterContainerXXXXXXX", "formFieldsXXXXXXX", "formAddFieldControlXXXXXXX", "formErrorMessageXXXXXXX", "formSubmitButtonXXXXXXX", XXXXXXX, true , true , false , "Thanks for responding!" );
theFormXXXXXXX.initializeField( 16, "", "", "", true, "", "", 631948 );
theFormXXXXXXX.initializeField( 1, "medium", "Your Name", "", true, "", "", 631949 );
theFormXXXXXXX.initializeField( 4, "medium", "Your Email", "", true, "", "", 631950 );
theFormXXXXXXX.initializeField( 1, "medium", "Subject", "", true, "", "Inquiry from website", 631951 );
theFormXXXXXXX.initializeField( 2, "medium", "Message", "", true, "", "", 631952 );
if (Squarespace.Orderable) { Squarespace.Orderable.ItemManager.initialize(); }
});
</script>
<div id="formOuterContainerXXXXXXX">
<div class="notice-box">
<div id="formEmptyMessageXXXXXXX">
This form does not yet contain any fields.
</div>
<ul class="form-body" id="formFieldsXXXXXXX"></ul>
<div id="formErrorMessageXXXXXXX" class="formErrorMessage error-text"></div>
</div>
</div>
Now, any style changes you want to make, open the original form in the style editor, and tose changes will be represented in the form pasted into the HTML. Hope this helps someone.
I hope squarespace will add this option,
Hi Scott,
We recently upgraded our YUI library, and the following file you referenced in your post above is no longer available:
/universal/yui/yahoo-dom-event/yahoo-get-dragdrop-connection.js
Instead, you must now reference:
/universal/yui/get/get-min.js
/universal/yui/dragdrop/dragdrop-min.js
/universal/yui/connection/connection-min.js
Hope this helps.
Hey Scott, Do you have to have "Email Template Control" or "Form Builder" in order to do this? In other words, what subscription level do you have to have? I have everything set up, it says sending (within the button) and then it says "Success!" (also within the button) and then the page refreshes. However, no email is sent. Could you help me out? Thanks so much - james



I don't want a page with just a simple form, I want to combine it with a Map (not SS map, no directions!!) I have all the code there, it seems right, it just will nor submit.
I created a form page, then copied the code out of it onto a HTML page and hid the form from my nav. any changes (stylistically speaking) I make to the hidden form shows up in the copied code.
http://riccophoto.squarespace.com/contact/
ideas? other approaches?