Class FormElement
A HTML Form Element provides ready access to the form fields/controls that are associated with it.
Inherited Members
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.