Skip to main content

Function: getAriaDescribedBy()

function getAriaDescribedBy(
id: string,
error?: string,
helpText?: string
): string | undefined;

Defined in: src/components/AddSiteForm/form-utils.ts:70

Determines the appropriate aria-describedby value for a form field.

Parametersโ€‹

idโ€‹

string

The unique field ID.

error?โ€‹

string

Error message, if present.

helpText?โ€‹

string

Help text, if present.

Returnsโ€‹

string | undefined

The aria-describedby value or undefined if neither error nor helpText is present.

Remarksโ€‹

If both error and helpText are present, error takes precedence for accessibility.