Attributes

Last updated:

The Formcentric Client can be configured using the attributes listed below.

Data Attribut

Function

Default

Type

data-fc-id Form ID -1 string
data-fc-src-url Path to Formcentric client resources https://form.formcentric.dev/form string
data-fc-formapp-url Path to formapp.js https://form.formcentric.com/form/formapp.js string
data-fc-skip-form-load Prevents the initialisation request from the form false boolean
data-fc-skip-templates-load Prevents the loading of templates false boolean
data-fc-vars Definition of custom variables that are used in the form.
Example:
data-fc-vars='{"test": "test"}'

see Preconfiguring forms with dynamic values.
null object
data-fc-language If defined, is set in the Accept-Language header, so as to load a required form language independently of the user’s browser language.
This is particularly useful if the embedding page offers users the option of switching languages.
null string (BCP 47)
data-fc-locale If defined, is set in the Accept-Language header, so as to load a required form language independently of the user’s browser language.
This is particularly useful if the embedding page offers users the option of switching languages.
null string (ICU)
data-fc-locales-path If this attribute is set, then the Formcentric client attempts to load a localisation file from this path at runtime (see Including your own translations). null string
data-fc-parent-url URL of the embedding page. Information about the application state can also be stored here. This information can then be restored when accessing a link generated by Formcentric (see Parent URL). window.location.href string
data-fc-debug Activates debug mode for extended logging during development. false boolean
data-fc-watch Enables an observer for attribute changes on the form container, allowing the form to be automatically re-initialized with the new settings.

This ensures the form dynamically updates without requiring a page reload.
false boolean

When using local themes

data-fc-theme-dir Specifies the path to the local theme directory. For example, this can be a subdirectory of your website’s public directory. null string
data-fc-theme Specifies which theme (theme’s directory name) should be used. If individual components of a theme are located in different places or their filenames have been changed, the following attributes can then be used for more detailed configuration of the file paths. null string
data-fc-theme-url Specifies the path to the styles.css for the theme. This file defines the CSS styles. null string
data-fc-template-url
Specifies the path to the script.js file for the theme. This file defines the template functions. null string
data-fc-theme-variable-url Specifies the path to the variables.json file for the theme. This file defines the CSS variables. null string

Feedback

Was this article helpful?