Interface IHtmlFormElement
- Namespace
- AngleSharp.Html.Dom
- Assembly
- AngleSharp.dll
Represents the form HTML element.
[DomName("HTMLFormElement")]
public interface IHtmlFormElement : IHtmlElement, IElement, INode, IEventTarget, IMarkupFormattable, IParentNode, IChildNode, INonDocumentTypeChildNode, IGlobalEventHandlers
- Inherited Members
- Extension Methods
Properties
AcceptCharset
Gets or sets the character encodings that are to be used for the submission.
[DomName("acceptCharset")]
string? AcceptCharset { get; set; }
Property Value
Action
Gets or sets the form's name within the forms collection.
[DomName("action")]
string Action { get; set; }
Property Value
Autocomplete
Gets or sets if autocomplete is turned on or off.
[DomName("autocomplete")]
string? Autocomplete { get; set; }
Property Value
Elements
Gets all the form controls belonging to this form element.
[DomName("elements")]
IHtmlFormControlsCollection Elements { get; }
Property Value
Encoding
Gets or sets the encoding to use for sending the form.
[DomName("encoding")]
string Encoding { get; set; }
Property Value
Enctype
Gets or sets the encoding to use for sending the form.
[DomName("enctype")]
string? Enctype { get; set; }
Property Value
this[int]
Gets the form element at the specified index.
[DomAccessor(Accessors.Getter)]
IElement? this[int index] { get; }
Parameters
index
intThe index in the elements collection.
Property Value
- IElement
The element or null.
this[string]
Gets the form element(s) with the specified name.
[DomAccessor(Accessors.Getter)]
IElement? this[string name] { get; }
Parameters
name
stringThe name or id of the element.
Property Value
- IElement
A collection with elements, an element or null.
Length
Gets the number of elements in the Elements collection.
[DomName("length")]
int Length { get; }
Property Value
Method
Gets or sets the method to use for transmitting the form.
[DomName("method")]
string Method { get; set; }
Property Value
Name
Gets or sets the value of the name attribute.
[DomName("name")]
string? Name { get; set; }
Property Value
NoValidate
Gets or sets the indicator that the form is not to be validated during submission.
[DomName("noValidate")]
bool NoValidate { get; set; }
Property Value
Target
Gets or sets the target name of the response to the request.
[DomName("target")]
string Target { get; set; }
Property Value
Methods
CheckValidity()
Checks if the form is valid, i.e. if all fields fulfill their requirements.
[DomName("checkValidity")]
bool CheckValidity()
Returns
- bool
True if the form is valid, otherwise false.
GetSubmission()
Creates the document request from the form submitting itself.
DocumentRequest? GetSubmission()
Returns
- DocumentRequest
The resulting document (e.g., HTTP) request.
GetSubmission(IHtmlElement)
Creates the document request from the form by submitting by some element.
DocumentRequest? GetSubmission(IHtmlElement sourceElement)
Parameters
sourceElement
IHtmlElementThe form's submitter.
Returns
- DocumentRequest
The resulting document (e.g., HTTP) request.
ReportValidity()
Reports the current validity state after checking the current state interactively the constraints of the form element.
[DomName("reportValidity")]
bool ReportValidity()
Returns
- bool
True if the form element is valid, otherwise false.
RequestAutocomplete()
Requests the input fields to be automatically filled with previous entries.
[DomName("requestAutocomplete")]
void RequestAutocomplete()
Reset()
Resets the form to the previous (default) state.
[DomName("reset")]
void Reset()
SubmitAsync()
Submits the form element from the form element itself.
[DomName("submit")]
Task<IDocument> SubmitAsync()
Returns
SubmitAsync(IHtmlElement)
Submits the form element as triggered from another element.
Task<IDocument> SubmitAsync(IHtmlElement sourceElement)
Parameters
sourceElement
IHtmlElementThe form's submitter.