-
Notifications
You must be signed in to change notification settings - Fork 26
Form Markup
Ryan Wold edited this page Aug 31, 2020
·
3 revisions
This page describes how a Touchpoints form works and how embedding a form interacts with your website.
Alternatively, a Touchpoint can be hosted on the site itself, alleviating the need to embed a form on your website.
After publishing a form, a script will be displayed. Copy the script to your page. When your webpage loads, this script will also load. Read the next section learn about what happens in the script.
<script src="https://touchpoints-demo.app.cloud.gov/touchpoints/776439e8/js" async></script>
When the javascript loads, a function called FBAform()
is written to the webpage's DOM, followed by a call to the function.
- Specify the formOptions. Only modalButtonText for now.
- create a new FBAForm object and pass it the document, window. Then initiate it with your Form Options.
var formOptions = {
'modalButtonText': "How can we improve this site?"
};
var touchpointFormName = new FBAform(document, window).init(formOptions);
The following markup is appended onto the current page: