Fill form fields from search query parameters of the page URL.
-
7.1
-
7.0
-
Squarespace plan that supports JavaScript.
- Yes
-
Install Form Block Wrapper Observe Changes. After you install the code be sure to continue on with the rest of the steps.
-
Options
-
Page Specific
-
This option will be the one most will want to use if you have only a single page you want to have this effect.
-
Add code from file form block fields from search parameters.html to Page Settings > Advanced > Page Header Code Injection for the page before the Form Block Wrapper Observe Changes code. Please see per-page code injection.
-
-
Site-wide
-
This option is the one you want to use if you have multiple pages where you want to have this effect.
-
Add code from file form block fields from search parameters.html to Website > Pages > Website Tools > Code Injection > FOOTER before the Form Block Wrapper Observe Changes code. Please see Add code to code injection.
-
-
-
Add or edit a form block.
-
In the Form Block Wrapper Observe Changes code add twcFbffsp to added per the Form Block Wrapper Observe Changes code install steps.
-
For each form field that you want to map from a search query string parameter key and put the parameter value into the field, add a line of the following format to DESCRIPTION.
twc-fbffsp : text
text is the search query string parameter key and would look like the following in a URL.
http://your-site.squarespace.com?text=your+text+here
For a compound field like Address add a line of the following format.
twc-fbffsp : first=First Name, last=Last Name
first and last are the search query string parameter keys and would look like the following in a URL.
http://your-site.squarespace.com?first=John&last=Doe
This effect is not active in Squarespace Preview to test it use private browsing.
This effect does not work with checkbox, radio, or survey fields.
You can see a demo of this effect here.
Please consider making a donation.
-
2024-04-28
- remove line field to trigger effect, adding the callback is the trigger
- bumped version to 0.2.0
-
2024-04-27
- update to work with Form Block Wrapper Observe Changes v0.3.0
- bumped version to 0.1.1
-
2022-07-28
- initial version