Form Helpers
Form Helpers Javascript
Find helpful form submission functions and variables at your fingertips with this library file.
Methods
LoadingIcon
Returns loading icon HTML
const helpers = new formHelpers4i();
helpers.LoadingIcon;
HeaderToken
Returns request verification token
helpers.HeaderToken;
RecaptchaKey
Returns RecaptchaSiteKey
helpers.RecaptchaKey;
RecaptchaName
Returns RecaptchaActionName
helpers.RecaptchaName;
ErrorMsgPanel
Returns error box HTML
helpers.ErrorMsgPanel;
ShowSuccessStatus()
Displays a green success status; Also focuses on the link if there is one
const elementToInsertBefore = document.querySelector(".btnParent");
const msg = 'Your account has been successfully updated.';
helpers.ShowSuccessStatus(elementToInsertBefore, msg);
ShowErrorStatus()
Displays a red error status
const elementToInsertBefore = document.querySelector(".btnParent");
const msg = 'There was an issue updating your account. Please refresh the page and try again or contact us if the issue continues.';
helpers.ShowErrorStatus(elementToInsertBefore, msg);
ClearStatus()
Removes all status messages
helpers.ClearStatus();
ShowBusyBtn()
Adds a round loading icon to the button text
helpers.ShowBusyBtn(e.currentTarget);
ClearBusyBtn()
Removes the loading icon from the button
helpers.ClearBusyBtn();
ShowLoadingOverlay()
Inserts a loading overlay to block the UI
const wrapperOfSectionToBlock = document.querySelector(".mySection");
helpers.ShowLoadingOverlay(wrapperOfSectionToBlock)
RemoveLoadingOverlay()
Removes the UI blocking loading overlay
helpers.RemoveLoadingOverlay();
Notes
Resources
Sass File(s) | None |
---|---|
JS File(s) | /library/forms/formhelpers.js |
JS Functions | See Above |
Locale Keys | None |
Accessibility
None at this time.