m Text replacement - "|Subject version=2.0,2.1" to "|Subject version=2.0,2.1,2.5" |
No edit summary |
||
| Line 36: | Line 36: | ||
'''- tempex''' attribute in FlexForm is a custom attribute | '''- tempex''' attribute in FlexForm is a custom attribute. | ||
Tempex stands for Template Execute. You can add this attribute to e.g. a text field, textarea, number field, etc.. The value of that field will be | Tempex stands for Template Execute. You can add this attribute to e.g. a text field, textarea, number field, etc.. The value of that field will be the result of an executed/parsed template. | ||
The value for tempex starts with the name of the template, followed by the field names in your form, all divided by a pipe. Those fields will be monitored for changes and when a change is detected the template is parsed and the result will be inserted into the field that has the tempex argument. This means you can have a template do various complex tasks and have the result shown in the Form for saving. But also something simple like this example : | |||
The value for tempex starts with the name of the template, followed by the field names in your form, all | |||
| Line 54: | Line 53: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
Of course there should be a '''Template:TestingTempex''' in your wiki in this example. | Of course there should be a '''Template:TestingTempex''' in your wiki in this example. It could then put a ready to go message with filled in name and email into the textarea and perhaps have FlexForm use it to send that content as an email. | ||
Latest revision as of 21:39, 23 March 2026
Name
input
Type
input
Synopsis
Create various input fields
Description
input is like input in HTML, but can differ sometimes.
Parameters
All valid HTML attributes can be used, like :
name, value, class, placeholder, required etc..
For possible types you can search the FlexForm docs for all documentation that starts with input.
Some examples for types are : text, url, phone, textarea, password, range, checkboxes, radiobutton, email and more.
There are some FlexForm specific attributes like parsepost and html.
- parsepost can be used on e.g. a hidden field where the value holds names of other fields to be switched at post processing. e.g.
This will read the form field value with name "title" and replace [title] in the value of the newtitle field
TODO: Above needs more details
<input type="number" name="Number" />
...
<input type="hidden" name="Number with prefix" value="nr. [Number]" parsepost />
- html attribute allows filtering input fields. The options are :
- "default" which is the same as not adding it at all. It will filter by the HTMLPurifier rules (see link below)
- "all" no filtering will be done (not even XSS hacks)
- "nohtml" means all HTML will be filtered out
- "custom" is used like this : "custom=b,u,i", meaning no html is allowed, except bold, italic and underline
- tempex attribute in FlexForm is a custom attribute.
Tempex stands for Template Execute. You can add this attribute to e.g. a text field, textarea, number field, etc.. The value of that field will be the result of an executed/parsed template.
The value for tempex starts with the name of the template, followed by the field names in your form, all divided by a pipe. Those fields will be monitored for changes and when a change is detected the template is parsed and the result will be inserted into the field that has the tempex argument. This means you can have a template do various complex tasks and have the result shown in the Form for saving. But also something simple like this example :
<form action="get" class="simple">
<label for="fname">First name</label> <input type="text" id="fname" name="First name" /><br>
<label for="lname">Last name</label><input type="text" id="lname" name="Last name" /><br>
<label for="email">email address</label> <input type="email" id="email" name="email" /><br>
<textarea size="150" name="total" class="tital" tempex="TestingTempex|First name|Last name|email" />
<input type="submit" value="getsend" />
</form>
Of course there should be a Template:TestingTempex in your wiki in this example. It could then put a ready to go message with filled in name and email into the textarea and perhaps have FlexForm use it to send that content as an email.
- required attribute in FlexForm differs from the HTML variant.
When a HTML5 form field has the word "required" as an attribute, this field will always be required. Even required="no" will make the field required.
With FlexForm this needs to be required="required" for an input field to be required. Only required or required="no" or required="whatever" will not make the field a required field.
Example on how to use required in FlexForm :
<input type="email" name="emailfield" placeholder="This is a placeholder" required="required" />