module:core_form/modalform

module:core_form/modalform

new (require("core_form/modalform"))(config)

Source:

Constructor

Shows the required form inside a modal dialogue

Parameters:
Name Type Description
config Object

parameters for the form and modal dialogue:

Members

events :Object

Source:

Various events that can be observed.

Type:
  • Object

(inner) list :jQuery

Source:

of elements with errors

Type:
  • jQuery

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

notifyResetFormChanges()

Source:

Notifies listeners that form dirty state should be reset.

Fires:
  • event:formSubmittedByJavascript

onSubmitError(exception)

Source:

On exception during form processing. Caller may override

Parameters:
Name Type Description
exception Object

processNoSubmitButton(button)

Source:

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

Parameters:
Name Type Description
button Element

button that was pressed

Fires:
  • event:formSubmittedByJavascript

(async) submitFormAjax()

Source:

Submit the form via AJAX call to the core_form_dynamic_form WS

validateElements() → {Boolean}

Source:

Validate form elements

Fires:
  • event:formSubmittedByJavascript
Returns:

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

Type
Boolean

(inner) setSaveButtonClasses(value)

Source:

Set the classes for the 'save' button.

Parameters:
Name Type Description
value String

The 'save' button classes.