[][src]Struct moxie_dom::elements::forms::FormBuilder

#[must_use = "needs to be built"]pub struct FormBuilder { /* fields omitted */ }

The HTML <form> element represents a document section that contains interactive controls for submitting information to a web server.

A type for initializing the element's attributes before calling build.


impl FormBuilder[src]

pub fn build(self) -> Form[src]

Initialize the element with all of the attributes so far.

impl FormBuilder[src]

pub fn accept_charset(self, to_set: impl ToString) -> Self[src]

Space-separated character encodings the server accepts. The browser uses them in the order in which they are listed. The default value means the same encoding as the page.

pub fn action(self, to_set: impl ToString) -> Self[src]

The URI of a program that processes the information submitted via the form.

pub fn autocomplete(self, to_set: impl ToString) -> Self[src]

Indicates whether input elements can by default have their values automatically completed by the browser. autocomplete attributes on form elements override it on

. Possible values:
  • off: The browser may not automatically complete entries. (Browsers tend to ignore this for suspected login forms; see The autocomplete attribute and login fields.)
  • on: The browser may automatically complete entries.

pub fn enctype(self, to_set: impl ToString) -> Self[src]

If the value of the method attribute is post, enctype is the MIME type of the form submission. Possible values:

  • application/x-www-form-urlencoded: The default value.
  • multipart/form-data: Use this if the form contains elements with type=file.
  • text/plain: Introduced by HTML5 for debugging purposes.

This value can be overridden by formenctype attributes on

pub fn method(self, to_set: impl ToString) -> Self[src]

The HTTP method to submit the form with. Possible values:

  • post: The POST method; form data sent as the request body.
  • get: The GET method; form data appended to the action URL with a ? separator. Use this method when the form has no side-effects.
  • dialog: When the form is inside a , closes the dialog on submission.

This value is overridden by formmethod attributes on

pub fn novalidate(self, to_set: bool) -> Self[src]

Indicates that the form shouldn't be validated when submitted. If this attribute is not set (and therefore the form is validated), it can be overridden by a formnovalidate attribute on a

pub fn rel(self, to_set: impl ToString) -> Self[src]

Creates a hyperlink or annotation depending on the value.

pub fn target(self, to_set: impl ToString) -> Self[src]

Indicates where to display the response after submitting the form. It is a name/keyword for a browsing context (for example, tab, window, or iframe). The following keywords have special meanings:

  • _self (default): Load into the same browsing context as the current one.
  • _blank: Load into a new unnamed browsing context.
  • _parent: Load into the parent browsing context of the current one. If no parent, behaves the same as _self.
  • _top: Load into the top-level browsing context (i.e., the browsing context that is an ancestor of the current one and has no parent). If no parent, behaves the same as _self.

This value can be overridden by a formtarget attribute on a

Trait Implementations

impl Element for FormBuilder[src]

impl<E> EventTarget<E> for FormBuilder where
    E: GlobalEvent

impl GlobalEventHandler for FormBuilder[src]

impl HtmlElement for FormBuilder[src]

impl Node for FormBuilder[src]

impl<Child> Parent<Child> for FormBuilder where
    Child: FlowContent

Auto Trait Implementations

impl !RefUnwindSafe for FormBuilder

impl !Send for FormBuilder

impl !Sync for FormBuilder

impl Unpin for FormBuilder

impl !UnwindSafe for FormBuilder

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized

impl<T> Borrow<T> for T where
    T: ?Sized

impl<T> BorrowMut<T> for T where
    T: ?Sized

impl<N> Child for N where
    N: Node

impl<T> Downcast for T where
    T: Any

impl<T> Erased for T

impl<T> From<T> for T[src]

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.