Line 1: | Line 1: | ||
===Name=== | ===Name=== | ||
− | + | input | |
===Type=== | ===Type=== | ||
− | + | input | |
===Synopsis=== | ===Synopsis=== | ||
− | Create various input | + | Create various input fields |
===Description=== | ===Description=== | ||
− | + | input is like input in HTML, but can differ sometimes. | |
===Parameters=== | ===Parameters=== | ||
All valid HTML attributes can be used, like : | All valid HTML attributes can be used, like : | ||
Line 12: | Line 12: | ||
name, value, class, placeholder, required etc.. | name, value, class, placeholder, required etc.. | ||
− | For possible types you can search the '''FlexForm''' docs for all documentation that starts with | + | 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. | Some examples for types are : text, url, phone, textarea, password, range, checkboxes, radiobutton, email and more. | ||
Line 42: | Line 42: | ||
<syntaxhighlight lang="html"> | <syntaxhighlight lang="html"> | ||
− | < | + | <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> |
</syntaxhighlight> | </syntaxhighlight> | ||
Line 61: | Line 61: | ||
Example on how to use required in FlexForm :<syntaxhighlight lang="html"> | Example on how to use required in FlexForm :<syntaxhighlight lang="html"> | ||
− | < | + | <input type="email" name="emailfield" placeholder="This is a placeholder" required="required" /> |
</syntaxhighlight> | </syntaxhighlight> | ||
Revision as of 22:25, 13 December 2022
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
- 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. This is in its beta status and is being tested and tweaked.
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 determent by 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 devided 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. 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.
- 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" />