Skip to content

Leaver forms

radios_with_conditionals(*args, **kwargs)

A wrapper function for Field.radios to add our custom JS to the field.

Returns:

Name Type Description
field Field

A Field object with the radios method applied to it.

Source code in leavers/forms/leaver.py
def radios_with_conditionals(*args, **kwargs) -> Field:
    """A wrapper function for Field.radios to add our custom JS to the field.

    Returns:
        field (Field): A Field object with the radios method applied to it.
    """

    field = Field.radios(*args, **kwargs)
    field.context.update(has_conditionals=True)
    return field