HtmlFormElement Class

https://html.spec.whatwg.org/multipage/forms.html#htmlformelement

public sealed class HtmlFormElement : HtmlElement
Inheritance
HtmlElement HtmlFormElement

Properties

NameDescription
AcceptCharsetGets or sets the value of the accept-charset content attribute.
ActionGets or sets the value of the action content attribute.
AutocompleteGets or sets the value of the autocomplete content attribute, limited to the known values (the canonical keyword, or the default value).
Elementshttps://html.spec.whatwg.org/multipage/forms.html#dom-form-elements: the listed elements whose form owner is the form, except image buttons, in tree order.
EncodingGets or sets the value of the enctype content attribute, limited to the known values (the canonical keyword, or the default value).
EnctypeGets or sets the value of the enctype content attribute, limited to the known values (the canonical keyword, or the default value).
LengthGets the number of listed form controls of the form.
MethodGets or sets the value of the method content attribute, limited to the known values (the canonical keyword, or the default value).
NameGets or sets the value of the name content attribute.
NoValidateGets or sets a value indicating whether the element has the novalidate content attribute.
RelGets or sets the value of the rel content attribute.
RelListGets the tokens of the rel content attribute.
TargetGets or sets the value of the target content attribute.

AcceptCharset

HtmlElements.g.cs

Gets or sets the value of the accept-charset content attribute.

public string AcceptCharset { get; set; }

Gets or sets the value of the action content attribute.

public string Action { get; set; }

Autocomplete

HtmlElements.g.cs

Gets or sets the value of the autocomplete content attribute, limited to the known values (the canonical keyword, or the default value).

public string Autocomplete { get; set; }

https://html.spec.whatwg.org/multipage/forms.html#dom-form-elements: the listed elements whose form owner is the form, except image buttons, in tree order.

public HtmlFormControlsCollection Elements { get; }

Gets or sets the value of the enctype content attribute, limited to the known values (the canonical keyword, or the default value).

public string Encoding { get; set; }

Gets or sets the value of the enctype content attribute, limited to the known values (the canonical keyword, or the default value).

public string Enctype { get; set; }

Gets the number of listed form controls of the form.

public uint Length { get; }

Gets or sets the value of the method content attribute, limited to the known values (the canonical keyword, or the default value).

public string Method { get; set; }

Gets or sets the value of the name content attribute.

public string Name { get; set; }

Gets or sets a value indicating whether the element has the novalidate content attribute.

public bool NoValidate { get; set; }

Gets or sets the value of the rel content attribute.

public string Rel { get; set; }

Gets the tokens of the rel content attribute.

public DomTokenList RelList { get; }

Gets or sets the value of the target content attribute.

public string Target { get; set; }

Indexers

NameDescription
this[string]The named getter (https://html.spec.whatwg.org/multipage/forms.html#dom-form-nameditem).
this[uint]Gets the listed form control at the given index, or null when the index is out of range.

Item overloads

this[string]

HtmlFormElement.cs

The named getter (https://html.spec.whatwg.org/multipage/forms.html#dom-form-nameditem).

public RadioNodeListOrElement? this[string name] { get; }

Gets the listed form control at the given index, or null when the index is out of range.

public Element? this[uint index] { get; }

Methods

NameDescription
CheckValidity()https://html.spec.whatwg.org/multipage/forms.html#dom-form-checkvalidity
ReportValidity()Checks the validity of the form controls, fires an invalid event on each invalid control and returns whether all of them are valid.
RequestSubmit(HtmlElement?)https://html.spec.whatwg.org/multipage/forms.html#dom-form-requestsubmit
Reset()https://html.spec.whatwg.org/multipage/forms.html#dom-form-reset
Submit()https://html.spec.whatwg.org/multipage/forms.html#dom-form-submit

CheckValidity()

HtmlFormElement.cs

https://html.spec.whatwg.org/multipage/forms.html#dom-form-checkvalidity

public bool CheckValidity()

ReportValidity()

HtmlFormElement.cs

Checks the validity of the form controls, fires an invalid event on each invalid control and returns whether all of them are valid.

public bool ReportValidity()

RequestSubmit(HtmlElement?)

HtmlFormElement.cs

https://html.spec.whatwg.org/multipage/forms.html#dom-form-requestsubmit

public void RequestSubmit(HtmlElement? submitter = null)

https://html.spec.whatwg.org/multipage/forms.html#dom-form-reset

public void Reset()

https://html.spec.whatwg.org/multipage/forms.html#dom-form-submit

public void Submit()