up.form up.form.fields(root)
JavaScript function

Returns a list of form fields within the given element.

You can configure what Unpoly considers a form field by adding CSS selectors to the up.form.config.fieldSelectors array.

If the given element is itself a form field, a list of that given element is returned.

If the given element is a <form> with an [id], the list also includes fields outside the form that are associated with it through a [form] attribute.

Fields in another layer and fields that are being destroyed are ignored.


Parameters

root
required

The element to scan for contained form fields.

If the element is itself a form field, a list of that element is returned.

Type: Element | jQuery

Return value

The field elements within the given element.

Type: List<Element>