Project to serve via CDN an embeddable OneBlink form.


Scripts

The script to include comes in a few different ways to allow people to choose the updates/breaks that want. Every deployment will upsert 4 files. If the next deployment is 1.2.3, the following 4 files will be created if they don't exist, or updated if they do:

  • 1.2.3.js - for the people who are super cautious and never want there scripts to break (or be updated)
  • 1.2.x.js - for the people who are cautious but like to stay up to date
  • 1.x.x.js - for the people who are cautious but prefer to be up to date
  • latest.js - or for the really hardcore who don't care if there website breaks

Examples

<!DOCTYPE html>
<html lang="en">
  <head>
    <!-- Must include Material Icons which are used by Form -->
    <link
      rel="stylesheet"
      href="https://fonts.googleapis.com/icon?family=Material+Icons"
    />

    <!-- OneBlink -->
    <script src="https://oneblink-forms.cdn.oneblink.io/{version}.js"></script>

    <script>
      window.addEventListener('load', function (event) {
        OneBlinkForms.render({
          selector: '#oneblink-form',
          formId: 1,
          formsAppId: 1,
          submissionRedirectUrl: 'https://submitted.example.com',
          cancelRedirectUrl: 'https://cancelled.example.com',
          googleMapsApiKey: 'GOOGLE_MAPS_API_KEY',
          captchaSiteKey: 'CAPTCHA_SITE_KEY',
        })
      })
    </script>
  </head>
  <body>
    <div id="oneblink-form"></div>
  </body>
</html>

OneBlinkForms.render() Options


PropertyTypeRequiredDescription
selectorstringYesThe selector to find a HTML Element to render the OneBlink Form inside.
formIdnumberYesThe identifier of the OneBlink Form to render.
formsAppIdnumberYesThe identifier of the OneBlink Forms App to submit the form to.
submissionRedirectUrlstringYesThe URL to redirect the user to after a successful submission. Will have submissionId added to query string before redirecting.
cancelRedirectUrlstringYesThe URL to redirect the user to if they cancel the form.
googleMapsApiKeystringConditionalA Google Maps API Key. Required if the form contains a location form element.
captchaSiteKeystringConditionalA reCAPTCHA Site Key. Required if the form contains a captcha form element.
externalIdstringNoAn identifier to match the form submission with in your system.
preFillDataObjectNoThe data to pre-fill the OneBlink Form.