Module: HtmlGrid::FormMethods

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

Constant Summary collapse

AUTOFILL =
false
ACCEPT_CHARSET =
$KCODE == 'UTF8' ? 'UTF-8' : 'ISO-8859-1'
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)


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

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

#eventObject



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

def event
	self::class::EVENT
end

#formnameObject



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

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

#onsubmit=(onsubmit) ⇒ Object



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

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