pub struct FormBuilder(/* private fields */);
Implementations§
Source§impl FormBuilder
impl FormBuilder
pub fn id(self, value: impl AttributeValue<String>) -> Self
pub fn class(self, value: impl AttributeValue<String>) -> Self
Sourcepub fn accept_charset(self, value: impl AttributeValue<String>) -> Self
pub fn accept_charset(self, value: impl AttributeValue<String>) -> Self
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.
Sourcepub fn action(self, value: impl AttributeValue<String>) -> Self
pub fn action(self, value: impl AttributeValue<String>) -> Self
The URI of a program that processes the information submitted via the form.
Sourcepub fn autocomplete(self, value: impl AttributeValue<String>) -> Self
pub fn autocomplete(self, value: impl AttributeValue<String>) -> Self
Indicates whether input elements can by default have their values automatically
completed by the browser. autocomplete attributes on form elements override it on
<form>
. 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.
Sourcepub fn enctype(self, value: impl AttributeValue<String>) -> Self
pub fn enctype(self, value: impl AttributeValue<String>) -> Self
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
<input>
elements with type=file. - text/plain: Introduced by HTML5 for debugging purposes.
This value can be overridden by formenctype attributes on <button>
,
<input type="submit">
, or <input type="image">
elements.
Sourcepub fn method(self, value: impl AttributeValue<String>) -> Self
pub fn method(self, value: impl AttributeValue<String>) -> Self
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
<dialog>
, closes the dialog on submission.
This value is overridden by formmethod attributes on <button>
,
<input type="submit">
, or <input type="image">
elements.
Sourcepub fn novalidate(self, value: impl AttributeValue<bool>) -> Self
pub fn novalidate(self, value: impl AttributeValue<bool>) -> Self
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 <button>
, <input type="submit">
, or <input type="image">
element
belonging to the form.
Sourcepub fn rel(self, value: impl AttributeValue<String>) -> Self
pub fn rel(self, value: impl AttributeValue<String>) -> Self
Creates a hyperlink or annotation depending on the value.
Sourcepub fn target(self, value: impl AttributeValue<String>) -> Self
pub fn target(self, value: impl AttributeValue<String>) -> Self
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 <button>
,
<input type="submit">
, or <input type="image">
element.