Prototype JavaScript framework

namespace Form.Element

Instance methods

  • activate

    Form.Element#activate(element) -> Element

    Gives focus to a form control and selects its contents if it is a text input.

  • clear

    Form.Element#clear() -> Element
    Form.Element.clear(element) -> Element

    Clears the contents of a text input. Returns the element.

    This method can be called either as an instance method or as a generic method. If calling as a generic, pass the instance in as the first argument.

  • disable

    Form.Element#disable() -> Element
    Form.Element.disable(element) -> Element

    Disables a form control, effectively preventing its value from changing until it is enabled again.

    This method can be called either as an instance method or as a generic method. If calling as a generic, pass the instance in as the first argument.

  • enable

    Form.Element#enable() -> Element
    Form.Element.enable(element) -> Element

    Enables a previously disabled form control.

    This method can be called either as an instance method or as a generic method. If calling as a generic, pass the instance in as the first argument.

  • getValue

    Form.Element#getValue() -> String | Array
    Form.Element.getValue(element) -> String | Array

    Returns the current value of a form control.

    A string is returned for most controls; only multiple select boxes return an array of values.

    The global shortcut for this method is $F.

    Alias of: $F

    This method can be called either as an instance method or as a generic method. If calling as a generic, pass the instance in as the first argument.

  • present

    Form.Element#present() -> Element
    Form.Element.present(element) -> Element

    Returns true if a text input has contents, false otherwise.

    This method can be called either as an instance method or as a generic method. If calling as a generic, pass the instance in as the first argument.

  • serialize

    Form.Element#serialize() -> String
    Form.Element.serialize(element) -> String

    Returns a URL-encoded string representation of a form control in the name=value format.

    This method can be called either as an instance method or as a generic method. If calling as a generic, pass the instance in as the first argument.

  • setValue

    Form.Element#setValue(value) -> Element
    Form.Element.setValue(element, value) -> Element

    Sets value to be the value of the form control. Returns the element.

    This method can be called either as an instance method or as a generic method. If calling as a generic, pass the instance in as the first argument.

Class methods

  • focus

    Form.Element.focus(element) -> Element

    Gives keyboard focus to an element. Returns the element.

  • select

    Form.Element.select(element) -> Element

    Selects the current text in a text input. Returns the element.