Table of Contents

Class HTMLFieldSetElement

Namespace
CSharpToJavaScript.APIs.JS
Assembly
CSharpToJavaScript.dll

The HTMLFieldSetElement interface provides special properties and methods (beyond the regular HTMLElement interface it also has available to it by inheritance) for manipulating the layout and presentation of {{ HTMLElement("fieldset") }} elements.

[Value("HTMLFieldSetElement")]
public class HTMLFieldSetElement : HTMLElement
Inheritance
HTMLFieldSetElement
Inherited Members

Remarks

-The HTML element implementing this interface: fieldset.

See also on MDN

Constructors

HTMLFieldSetElement()

public HTMLFieldSetElement()

Properties

Disabled

The disabled property of the HTMLFieldSetElement interface is a boolean value that reflects the {{htmlelement("fieldset")}} element's disabled attribute, which indicates whether the control is disabled.

[Value("disabled")]
public bool Disabled { get; set; }

Property Value

bool

A boolean value.

Remarks

When disabled, all the form control descendants of the <fieldset> element, excluding elements that are descendants of the legend child of the <fieldset>, if any, are disabled. A disabled element is unusable and un-clickable, and match the :disabled selector, even if their disabled property value is false.

-HTML disabled attribute
-CSS :disabled and :enabled pseudoclasses

See also on MDN

Elements

The elements read-only property of the HTMLFieldSetElement interface returns an HTMLCollection object containing all form control elements ({{htmlelement("button")}}, {{htmlelement("fieldset")}}, {{htmlelement("input")}}, {{htmlelement("object")}}, {{htmlelement("output")}}, {{htmlelement("select")}}, and {{htmlelement("textarea")}}) that are descendants of this field set.

[Value("elements")]
public HTMLCollection Elements { get; }

Property Value

HTMLCollection

An HTMLCollection.

Remarks

You can access a particular form control in the returned collection by using either an
index or the element's name or id attributes. If multiple form controls share the same name, as is common with a group of radio buttons, using the shared name returns the first element with that value.

-HTMLFieldSetElement
-Elements
-fieldset

See also on MDN

Form

The form read-only property of the HTMLFieldSetElement interface returns an HTMLFormElement object that owns this {{htmlelement("fieldset")}}, or null if this fieldset is not owned by any form.

[Value("form")]
public HTMLFormElement? Form { get; }

Property Value

HTMLFormElement

An HTMLFormElement or null.

Remarks

Name

The name property of the HTMLFieldSetElement interface indicates the name of the {{HTMLElement("fieldset")}} element. It reflects the element's name attribute.

[Value("name")]
public string Name { get; set; }

Property Value

string

A string representing the element's name.

Remarks

Type

The type read-only property of the HTMLFieldSetElement interface returns the string "fieldset".

[Value("type")]
public string Type { get; }

Property Value

string

The string "fieldset".

Remarks

ValidationMessage

The validationMessage read-only property of the HTMLFieldSetElement interface returns a string representing a localized message that describes the validation constraints that the {{htmlelement("fieldset")}} control does not satisfy (if any). This is the empty string as <fieldset> elements are not candidates for constraint validation (WillValidate is false).

[Value("validationMessage")]
public string ValidationMessage { get; }

Property Value

string

The empty string, "";

Remarks

Validity

The validity read-only property of the HTMLFieldSetElement interface returns a ValidityState object that represents the validity states this element is in. Although {{HTMLElement("fieldset")}} elements are never candidates for constraint validation, the validity state may still be invalid if a custom validity message has been set.

[Value("validity")]
public ValidityState Validity { get; }

Property Value

ValidityState

A ValidityState object.

Remarks

NOTE

The :valid and :invalid CSS pseudo-classes are applied to <fieldset> elements based on the validity of its descendant form controls, not the fieldset itself.

-CheckValidity()
-fieldset
-form
-Learn: Client-side form validation
-Guide: Constraint validation

See also on MDN

WillValidate

The willValidate read-only property of the HTMLFieldSetElement interface returns false, because fieldset elements are not candidates for constraint validation.

[Value("willValidate")]
public bool WillValidate { get; }

Property Value

bool

The boolean value false.

Remarks

Methods

CheckValidity()

The checkValidity() method of the HTMLFieldSetElement interface checks if the element is valid, but always returns true because {{HTMLElement("fieldset")}} elements are never candidates for constraint validation.

[Value("checkValidity")]
public bool CheckValidity()

Returns

bool

A boolean value, true.

Remarks

NOTE

The :valid and :invalid CSS pseudo-classes are applied to <fieldset> elements based on the validity of its descendant form controls, not the fieldset itself.

-ReportValidity()
-fieldset
-form
-Learn: Client-side form validation
-Guide: Constraint validation

See also on MDN

ReportValidity()

The reportValidity() method of the HTMLFieldSetElement interface performs the same validity checking steps as the CheckValidity() method. It always returns true because {{HTMLElement("fieldset")}} elements are never candidates for constraint validation.

[Value("reportValidity")]
public bool ReportValidity()

Returns

bool

A boolean value, true.

Remarks

SetCustomValidity(string)

The setCustomValidity() method of the HTMLFieldSetElement interface sets the custom validity message for the {{htmlelement("fieldset")}} element. Use the empty string to indicate that the element does not have a custom validity error.

[Value("setCustomValidity")]
public GlobalObject.Undefined SetCustomValidity(string error)

Parameters

error string

Returns

GlobalObject.Undefined

None (GlobalObject.Undefined).

Remarks

The <fieldset> element is not a candidate for constraint validation. The ReportValidity() method will not cause the custom error message to be displayed to the user, but does set the CustomError property of the element's ValidityState object to true and the Valid property to false.

-fieldset
-HTMLFieldSetElement
-Validity
-CheckValidity()
-ReportValidity()
-Form validation.
-Learn: Client-side form validation
-Guide: Constraint validation
-CSS :valid and :invalid pseudo-classes

See also on MDN