• JMap.Form.getDefaultValues

    Returns the default data values of the form.

    The result is an object where :

    • key is the attribute id
    • value the default value

    Parameters

    • formMetaData: JFormMetaData

      A JMap form metadata

    • Optional initialData: JAttributeValueByName

      Initial data. If provided, it will set the default data then overwrite with initial values.

    Returns JAttributeValueByName

    a key/value object

    Example

    const form = ...
    const defaultValues = JMap.Form.getDefaultValues(form)