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



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

def event
  self::class::EVENT
end

#formnameObject



45
46
47
48
49
# File 'lib/htmlgrid/form.rb', line 45

def formname
  if(defined? self::class::FORM_NAME)
    self::class::FORM_NAME 
  end
end

#onsubmit=(onsubmit) ⇒ Object



50
51
52
# File 'lib/htmlgrid/form.rb', line 50

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

#to_html(context) ⇒ Object



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

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