Module: HtmlGrid::FormMethods

Included in:
DivForm, Form, FormList
Defined in:
lib/htmlgrid/form.rb

Constant Summary collapse

AUTOFILL =
false
ACCEPT_CHARSET =
"UTF-8"
EVENT =
nil
FORM_ACTION =
nil
FORM_METHOD =
"POST"
FORM_NAME =
"stdform"
TAG_METHOD =
:form

Instance Method Summary collapse

Instance Method Details

#autofill?Boolean

Returns:

  • (Boolean)


39
40
41
# File 'lib/htmlgrid/form.rb', line 39

def autofill?
  self.class.const_get(:AUTOFILL)
end

#eventObject



43
44
45
# File 'lib/htmlgrid/form.rb', line 43

def event
  self.class::EVENT
end

#formnameObject



47
48
49
50
51
# File 'lib/htmlgrid/form.rb', line 47

def formname
  if defined? self.class::FORM_NAME
    self.class::FORM_NAME
  end
end

#onsubmit=(onsubmit) ⇒ Object



53
54
55
# File 'lib/htmlgrid/form.rb', line 53

def onsubmit=(onsubmit)
  @form_properties["onSubmit"] = onsubmit
end

#to_html(context) ⇒ Object



57
58
59
60
61
# File 'lib/htmlgrid/form.rb', line 57

def to_html(context)
  context.send(self.class::TAG_METHOD, @form_properties) {
    super << context.div("style" => "display:none") { hidden_fields(context) }
  }
end