Class: FormElements::Form

Inherits:
ContainerElement
  • Object
show all
Defined in:
lib/reparcs/elements/form_elements.rb

Overview

A form element

Instance Method Summary collapse

Constructor Details

#initialize(attrs = {}) ⇒ Form

Creates a new Form element, takes an optional hash of attributes as parameter.



61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
# File 'lib/reparcs/elements/form_elements.rb', line 61

def initialize(attrs={})
  aattrs = [
    "class", "id", "title", "dir", "xml:lang",
    "onclick", "ondblclick", "onkeydown", "onkeypress",
    "onkeyup", "onmousedown", "onmousemove", "onmouseout",
    "onmouseover", "onmouseup", "accept", "accept-charsets",
    "action", "enctype", "method", "onreset", "onsubmit"
  ]
  childs = [
    "address", "blockquote", "del", "div", "dl", "fieldset",
    "h1", "h2", "h3", "h4", "h5", "h6", "hr", "ins", 
    "noscript", "ol", "p", "pre", "script", "table", "ul"
  ]
  super("form", aattrs, childs, attrs)
  @start_element = "<form"
  @end_element = "</form>"
end