Form

public final class Form : GenericElement

Form tag element class

### Usage Example: ###

  let form = Form((("method"),("POST")))
  let fieldset = Fieldset()

  let labelName = Label("Name")
  labelName.addAttribute(("for", "nameField"))
  fieldset.add(labelName)

  let inputName = InputText("", id: "nameField", placeholder: "Name")
  fieldset.add(inputName)

  let labelAge = Label("Age Range")
  labelAge.addAttribute(("for", "ageRangeField"))
  fieldset.add(labelAge)

  form.add(fieldset)
  • tag

    Override tag element for element. Default is form

    Declaration

    Swift

    override var tag: String { get }
  • Override container element defaults is true

    Declaration

    Swift

    override var container: Bool { get }
  • This method append a new element in objects list

    Declaration

    Swift

    public func add(_ element: GenericElement)

    Parameters

    element