module:core_form/dynamicform

module:core_form/dynamicform

new (require("core_form/dynamicform"))(container, formClass)

Source:

Constructor

Creates an instance

Parameters:
Name Type Description
container Element

the parent element for the form

formClass string

full name of the php class that extends \core_form\modal , must be in autoloaded location

Classes

core_form/dynamicform

Members

events :Object

Source:

Various events that can be observed.

Type:
  • Object

Methods

addEventListener(…args)

Source:

Add listener for an event

Parameters:
Name Type Attributes Description
args array <repeatable>

disableButtons()

Source:

Disable buttons during form submission

enableButtons()

Source:

Enable buttons after form submission (on validation error)

getFormNode() → {HTMLFormElement}

Source:

Get the form node from the Dialogue.

Returns:
Type
HTMLFormElement

load(args) → {Promise}

Source:

Loads the form via AJAX and shows it inside a given container

Parameters:
Name Type Default Description
args Object null
Returns:
Type
Promise

notifyResetFormChanges()

Source:

Notifies listeners that form dirty state should be reset.

Fires:
  • event:formSubmittedByJavascript

onSubmitSuccess(response)

Source:

On form submit

Parameters:
Name Type Description
response *

Response received from the form's "process" method

processCancelButton()

Source:

Click on a "cancel" button

(async) submitFormAjax()

Source:

Submit the form via AJAX call to the core_form_dynamic_form WS

updateForm(param) → {Promise}

Source:

Update form contents

Parameters:
Name Type Description
param object
Properties
Name Type Description
html string
js string
Returns:
Type
Promise

validateElements() → {Boolean}

Source:

Validate form elements

Fires:
  • event:formSubmittedByJavascript
Returns:

Whether client-side validation has passed, false if there are errors

Type
Boolean

(inner) submitButtonPressed(button)

Source:

Click on a "submit" button that is marked in the form as registerNoSubmitButton()

Parameters:
Name Type Description
button Element

that was pressed

Fires:
  • event:formSubmittedByJavascript