Show / Hide Table of Contents

Class FormElement

A HTML Form Element provides ready access to the form fields/controls that are associated with it.

Inheritance
System.Object
Node
Element
FormElement
Inherited Members
Element.TagName
Element.Tag
Element.IsBlock
Element.Id
Element.Dataset
Element.Parent
Element.Parents
Element.Child(Int32)
Element.Children
Element.TextNodes
Element.DataNodes
Element.Select(String)
Element.AppendChild(Node)
Element.PrependChild(Node)
Element.InsertChildren(Int32, IEnumerable<Node>)
Element.AppendElement(String)
Element.PrependElement(String)
Element.AppendText(String)
Element.PrependText(String)
Element.Append(String)
Element.Prepend(String)
Element.Before(String)
Element.Before(Node)
Element.After(String)
Element.After(Node)
Element.Empty()
Element.Wrap(String)
Element.CssSelector
Element.SiblingElements
Element.NextElementSibling
Element.PreviousElementSibling
Element.FirstElementSibling
Element.ElementSiblingIndex
Element.LastElementSibling
Element.GetElementsByTag(String)
Element.GetElementById(String)
Element.GetElementsByClass(String)
Element.GetElementsByAttribute(String)
Element.GetElementsByAttributeStarting(String)
Element.GetElementsByAttributeValue(String, String)
Element.GetElementsByAttributeValueNot(String, String)
Element.GetElementsByAttributeValueStarting(String, String)
Element.GetElementsByAttributeValueEnding(String, String)
Element.GetElementsByAttributeValueContaining(String, String)
Element.GetElementsByAttributeValueMatching(String, Regex)
Element.GetElementsByAttributeValueMatching(String, String)
Element.GetElementsByIndexLessThan(Int32)
Element.GetElementsByIndexGreaterThan(Int32)
Element.GetElementsByIndexEquals(Int32)
Element.GetElementsContainingText(String)
Element.GetElementsContainingOwnText(String)
Element.GetElementsMatchingText(Regex)
Element.GetElementsMatchingText(String)
Element.GetElementsMatchingOwnText(Regex)
Element.GetElementsMatchingOwnText(String)
Element.GetAllElements()
Element.Text
Element.OwnText
Element.HasText
Element.Data
Element.ClassName
Element.ClassNames
Element.HasClass(String)
Element.AddClass(String)
Element.RemoveClass(String)
Element.ToggleClass(String)
Element.Val
Element.Html
Element.ToString()
Element.Equals(Object)
Element.GetHashCode()
Node.Attr(String)
Node.Attributes
Node.Attr(String, String)
Node.HasAttr(String)
Node.RemoveAttr(String)
Node.BaseUri
Node.AbsUrl(String)
Node.ChildNode(Int32)
Node.ChildNodes
Node.ChildNodesCopy()
Node.ChildNodeSize
Node.OwnerDocument
Node.Remove()
Node.Unwrap()
Node.ReplaceWith(Node)
Node.SiblingNodes
Node.NextSibling
Node.PreviousSibling
Node.SiblingIndex
Node.OuterHtml
Namespace: Supremes.Nodes
Assembly: Supremes.dll
Syntax
public sealed class FormElement : Element
Remarks

It also allows a form to easily be submitted.

Properties

Elements

Get the list of form control elements associated with this form.

Declaration
public Elements Elements { get; }
Property Value
Type Description
Elements

form controls associated with this element.

FormData

Get the data that this form submits.

Declaration
public IList<KeyValuePair<string, string>> FormData { get; }
Property Value
Type Description
IList<KeyValuePair<System.String, System.String>>

a list of key vals

Remarks

The returned list is a copy of the data, and changes to the contents of the list will not be reflected in the DOM.

Methods

AddElement(Element)

Add a form control element to this form.

Declaration
public FormElement AddElement(Element element)
Parameters
Type Name Description
Element element

form control to add

Returns
Type Description
FormElement

this form element, for chaining

SubmitAsync(HttpClient)

submit this form, using a specified HttpClient.

Declaration
public Task<HttpResponseMessage> SubmitAsync(HttpClient client)
Parameters
Type Name Description
HttpClient client
Returns
Type Description
Task<HttpResponseMessage>

an async task.

Remarks

the request will be set up from the form values. You can set up other options (like user-agent, timeout, cookies) before executing.

SubmitAsync(HttpClient, CancellationToken)

submit this form, using a specified HttpClient.

Declaration
public Task<HttpResponseMessage> SubmitAsync(HttpClient client, CancellationToken cancellationToken)
Parameters
Type Name Description
HttpClient client
CancellationToken cancellationToken
Returns
Type Description
Task<HttpResponseMessage>

an async task.

Remarks

the request will be set up from the form values. You can set up other options (like user-agent, timeout, cookies) before executing.

Extension Methods

FluentUtility.TagName(Element, String)
FluentUtility.ClassNames(Element, ICollection<String>)
FluentUtility.Val(Element, String)
FluentUtility.Html(Element, String)
Back to top Generated by DocFX