Class FormElement


@TagName("form") public class FormElement extends Element
The FORM element encompasses behavior similar to a collection and an element. It provides direct access to the contained form controls as well as the attributes of the form element.
See Also:
  • Field Details

  • Constructor Details

    • FormElement

      protected FormElement()
  • Method Details

    • as

      public static FormElement as(Element elem)
      Assert that the given Element is compatible with this class and automatically typecast it.
    • is

      public static boolean is(JavaScriptObject o)
      Determines whether the given JavaScriptObject can be cast to this class. A null object will cause this method to return false.
    • is

      public static boolean is(Node node)
      Determine whether the given Node can be cast to this class. A null node will cause this method to return false.
    • is

      public static boolean is(Element elem)
      Determine whether the given Element can be cast to this class. A null node will cause this method to return false.
    • getAcceptCharset

      public final String getAcceptCharset()
      List of character sets supported by the server.
      See Also:
    • getAction

      public final String getAction()
      Server-side form handler.
      See Also:
    • getElements

      public final NodeCollection<Element> getElements()
      Returns a collection of all form control elements in the form.
    • getEnctype

      public final String getEnctype()
      The content type of the submitted form, generally "application/x-www-form-urlencoded". Note: The onsubmit even handler is not guaranteed to be triggered when invoking this method. The behavior is inconsistent for historical reasons and authors should not rely on a particular one.
      See Also:
    • getMethod

      public final String getMethod()
      HTTP method [IETF RFC 2616] used to submit form.
      See Also:
    • getName

      public final String getName()
      Names the form.
    • getTarget

      public final String getTarget()
      Frame to render the resource in.
      See Also:
    • reset

      public final void reset()
      Restores a form element's default values. It performs the same action as a reset button.
    • setAcceptCharset

      public final void setAcceptCharset(String acceptCharset)
      List of character sets supported by the server.
      See Also:
    • setAction

      public final void setAction(SafeUri action)
      Server-side form handler.
      See Also:
    • setAction

      public final void setAction(String action)
      Server-side form handler.
      See Also:
    • setEnctype

      public final void setEnctype(String enctype)
      The content type of the submitted form, generally "application/x-www-form-urlencoded". Note: The onsubmit even handler is not guaranteed to be triggered when invoking this method. The behavior is inconsistent for historical reasons and authors should not rely on a particular one.
      See Also:
    • setMethod

      public final void setMethod(String method)
      HTTP method [IETF RFC 2616] used to submit form.
      See Also:
    • setName

      public final void setName(String name)
      Names the form.
    • setTarget

      public final void setTarget(String target)
      Frame to render the resource in.
      See Also:
    • submit

      public final void submit()
      Submits the form. It performs the same action as a submit button.