Created by staff of the U.S. Securities and Exchange Commission.
Data and content created by government employees within the scope of their employment are not subject to domestic copyright protection. 17 U.S.C. 105.

# form.js README

## Purpose

High level Developer information regarding the Ajax Form functionality

## Variables

- N/A

## Functions

- `AjaxForm.init()`
  - Arguments:
    - callback
  - If `HelpersUrl.getAllParams` is set
    - Get `HelpersUrl.getAllParams['docPath']`
    - Ensure the User is shown the Loading Section
    - Create new XHR function
    - Begin XHR with `HelpersUrl.getAllParams['docPath']`
    - If the XHR `readystate` is 4 and the status is 200
      - Run `Errors.checkFileSizeForLimits()`
      - Find `<html>` attributes via Regex for example `<html xmlns:ix="http://www.xbrl.org/2013/inlineXBRL" ...>`
      - Run `ConstantsFunctions.setHTMLAttributes()` based on the above step
      - Set #dynamic-xbrl-form as the response from the XHR request
      - Run `ConstantsFunctions.setHTMLPrefix()`
      - Find `<body>` attributes via Regex for example `<body style="color: orange;">`
      - Run `ConstantsFunctions.setParentContainerStyles()` based on the above step
      - Hide the Loading Section from the User
      - `callback(true)` indicating the application is good
    - If the XHR `readystate` is 4 and the status is not 200
      - Hide the Loading Section from the User
      - `callback(false)` indicating an error has occurred
  - If `HelpersUrl.getAllParams` is not set
    - Hide the Loading Section from the User
    - `callback(false)` indicating an error has occurred

## Related

- ConstantsFunctions
- Errors
- ErrorsMinor
- HelpersUrl