module:core_form/modalform

module:core_form/modalform

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

Description:
  • Constructor

    Shows the required form inside a modal dialogue

Source:
Parameters:
Name Type Description
config Object

parameters for the form and modal dialogue:

Members

events :Object

Description:
  • Various events that can be observed.

Source:

Various events that can be observed.

Type:
  • Object

(inner) list :jQuery

Description:
  • of elements with errors

Source:

of elements with errors

Type:
  • jQuery

Methods

addEventListener(…args)

Description:
  • Add listener for an event

Source:
Parameters:
Name Type Attributes Description
args array <repeatable>

disableButtons()

Description:
  • Disable buttons during form submission

Source:

enableButtons()

Description:
  • Enable buttons after form submission (on validation error)

Source:

getFormNode() → {HTMLFormElement}

Description:
  • Get the form node from the Dialogue.

Source:
Returns:
Type
HTMLFormElement

notifyResetFormChanges()

Description:
  • Notifies listeners that form dirty state should be reset.

Source:
Fires:
  • event:formSubmittedByJavascript

onSubmitError(exception)

Description:
  • On exception during form processing. Caller may override

Source:
Parameters:
Name Type Description
exception Object

processNoSubmitButton(button)

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

Source:
Parameters:
Name Type Description
button Element

button that was pressed

Fires:
  • event:formSubmittedByJavascript

(async) submitFormAjax()

Description:
  • Submit the form via AJAX call to the core_form_dynamic_form WS

Source:

validateElements() → {Boolean}

Description:
  • Validate form elements

Source:
Fires:
  • event:formSubmittedByJavascript
Returns:

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

Type
Boolean

(inner) setSaveButtonClasses(value)

Description:
  • Set the classes for the 'save' button.

Source:
Parameters:
Name Type Description
value String

The 'save' button classes.