Module:FF




invoke within form

{{#invoke:FF|input 
|type=text 
|name=myname
|value=Value here 
|id=fff-443434 
|class=form-control

|label=Name
|template=Data item

|slot=
|param=
|template=
}}


Getdata

Kikkers en tongzoenen - Sarah Mlynowski (2007), 1ᵉ druk, Uitgeverij Van Goor Unieboek BV, Houten:

Scriptfout: de functie "getdata" bestaat niet.

Works with parser function though


Titel/-787178247

getdatatest

Scriptfout: de functie "getdatatest" bestaat niet.


local p = {}

p.form1 = function(frame)
	-- test of frame:callParserFunction
	-- {{#tag:form||id=bla|action=get}}
	local content = 'Test'
	local formparams = { 'form', content, id = 'bla', action = 'get' }
	local str = frame:callParserFunction( '#tag', formparams )
	return str
end

--[[
Makes more sense than using callParserFunction
but "equivalent to a call to frame:callParserFunction() with function name '#tag' "
]]--
p.form2 = function(frame)
	-- frame:extensionTag( name, content, args )
	local content = 'Test'
	local tag = 'form'
	local args = { id = 'bla', action = 'get' }
	local str = frame:extensionTag( tag, content, args )
	return str
end

p.inputtext = function(frame)
	-- frame:extensionTag( name, content, args )
	local tag = '_input'
	local content = frame.args.text or ""
	local inputtype = frame.args.type or ""
	local inputname = frame.args.name or ""
	local inputvalue = frame.args.value or ""
	local inputid = frame.args.id or ""
	local inputclass = frame.args.class or ""

	local args = {}
	--foreach here so we don't get empty attr
	local args = { id = inputid, type = inputtype, value = inputvalue, class = inputclass }
	
	local str = frame:extensionTag(
		tag,
		'content here',
		{ id = inputid, type = inputtype, value = inputvalue, class = inputclass }
	)
	return str
end

p.inputtest = function(frame)
	local tag = '_input'
	local str = frame:extensionTag( tag, 'Some text here', { name = 'foo', type = 'textarea' } )
	return str
end

return p