m3e/form_submission
form_submitter_type provides types and related functions for handling form submission elements
Types
FormSubmission is the fields used when an element is submitted as part of a form
Fields:
- type_: The submission type of the element
- name: The name of the element, submitted as a pair with the element’s value as part of form data, when the element is used to submit a form
- value: The value associated with the element’s name when it’s submitted with form data
pub type FormSubmission {
FormSubmission(
type_: FormSubmitterType,
name: String,
value: String,
)
}
Constructors
-
FormSubmission( type_: FormSubmitterType, name: String, value: String, )
FormSubmitterType is the type of an element when used inside a form
pub type FormSubmitterType {
Button
Reset
Submit
}
Constructors
-
Button -
Reset -
Submit
Values
pub fn attributes(
fs: option.Option(FormSubmission),
) -> List(attribute.Attribute(msg))
pub fn button_attributes(
fs: option.Option(FormSubmission),
) -> List(attribute.Attribute(msg))
attributes creates Lustre Attributes for a FormSubmission
pub const default_form_submitter_type: FormSubmitterType
pub fn form_submitter_type_to_string(
t: FormSubmitterType,
) -> String
form_submitter_type_to_string converts a FormSubmitterType to a string
pub fn type_(
fs: FormSubmission,
type_: FormSubmitterType,
) -> FormSubmission
type_ sets the type_ field
pub fn value(fs: FormSubmission, value: String) -> FormSubmission
value sets the value field