Saltar al contenido principal

Function: setFields()

function setFields(
page,
values,
formSelector?
): Promise<void>;

Defined in: core/forms.ts:75

Sets fields by their form name: text inputs and textareas (through TinyMCE when it edits them), selects (several values for a multiple one), checkboxes and radios, in the order given (a field can enable the next one). Throws FormError naming the fields the form doesn't have, and those it has disabled: Moodle wouldn't send them, and the change would be lost unnoticed.

Parameters​

ParameterTypeDefault value
pagePageundefined
valuesRecord<string, FieldValue>undefined
formSelectorstring"form.mform"

Returns​

Promise<void>