Interface Window

Hierarchy

  • Window

Index

Properties

XFC_METADATA

XFC_METADATA: XfcMetadata

This object contains meta data related to the currently opened form; such as the state of the form, the user that is currently signed in, the the form record and much more.

To access this information via JavaScript, use the global JavaScript object window.XFC_METADATA. When you open a form, this object is added automatically and filled with the relevant information.

XM_FORM_I18N

XM_FORM_I18N: object

An object contain all I18N (internationalization) language keys and the corresponding values, such as the error message that shows up when a required field is left blank.

Type declaration

  • [i18nKey: string]: string

XM_FORM_VRULES

XM_FORM_VRULES: XmFormVrule

An object that contains all the RegExps for the different data types of input fields.

xm_validator

xm_validator: XmValidator

A reference to the form validator. It may be used to interact with the validation process, such as listening to certain events during the validation process.

Methods

getProjektId

  • getProjektId(): number | null
  • Returns number | null

    The current ID of the form. null when no form exists.

getURLParameter

  • getURLParameter(name: string): string | undefined
  • Retrieves the value of the named URL parameter. In case a parameter is specified multiple times, only the value of the first occurence is returned.

    If the URL is as follows:

    https://formcloud.de/formcycle/form/provide/9999?name=James&preview&mode=&name=John

    Then this function returns:

    getURLParameter("name"); // => "James"
    getURLParameter("preview") // => undefined
    getURLParameter("mode"); // => ""
    getURLParameter("other"); // => undefined

    Parameters

    • name: string

      Name of the URL parameter to retrieve.

    Returns string | undefined

    The value of the URL parameter with the given name, or undefined if no such URL parameter exists.

gotoPage

  • gotoPage(pageName: string, validate?: boolean): void
  • A FORMCYCLE form may consist of multiple pages. This function lets you change to another page. You may also specify whether navigation should be prevented in case the current page is invalid (eg. due to required fields that are still blank).

    // Go to page 2, but only if all form fields on the current page are valid
    gotoPage("p2", true);
    
    // Go to page 2 and do not check any form fields
    gotoPage("p2");

    Parameters

    • pageName: string

      The name of the page to goto. This is the name given to the page in the designer.

    • Optional validate: boolean

      Set to true to prevent the page change in case the current page is invalid. Set to false to perform the navigation irrespective of whether the current page is valid.

    Returns void

setValidate

  • setValidate(doValidate: boolean): void
  • Lets you disable or enable form validation. If validation is disabled, the form may be submitted event if it is invalid (eg. when it contains required fields that are still blank).

    Note that even if form validation is enabled, a client may still submit the form if they disable JavaScript or setup an appropriate HTTP request. To prevent this, you may want to enable server side validation in the designer.

    Parameters

    • doValidate: boolean

      Set to false to disable form validation. Set to true to enable form validation.

    Returns void