![]() | |
Laboratoire indépendant de recherche conviviale sur l'auto-production, la gratuité et la culture libre | |
∏ - À propos / Fonctionnement \ Admin - ∃ - Collecter des données / Évaluer \ Publier / Discuter \ Décider / Les contributeurs - ∈ - La Fabrique / Recherches \ Textes / Blog \ En chantier / La gratuiterie - ∑ - Le Boomerang / CEDREA \ Entrez sans payer / nonmarchand.org |
Autoproduction / Culture libre / Économie non-marchande / Libertés / Recherche conviviale / Critique de la science économique / Critique de l'économie marchande alternative / De tout et de rien |
Vue - Éditer - Historique - Imprimer - Référencé par |
Inscription - Connexion |
PmWiki /
FormsThis page explains how you can embed input forms into wiki pages. Input forms don't actually handle processing of the form data -- the feature simply allows creation of forms inside wiki pages. Forms processing can be found in the Cookbook (see below). MarkupTwo directives are used to begin and end forms: The If your site uses ?n=Group.Page to specify the pagename then having a field The Note that this feature doesn't ensure that the form output is correct HTML -- it assumes the author knows a little bit of what he or she is doing. Notably, Standard input controlsThe standard input controls are: Where name and value are in the HTML syntax: name="addr" value="808 W Franklin". For most controls the markup has the form: where type is the type of input element (described below), name is the name of the control, value is its initial value, and parameters are used to specify additional attributes to the control. If value contains spaces, enclose it in quotes; if it contains newlines (for textarea and hidden elements), enclose it in For example, the following creates a text input control with a size of 30 characters:
For convenience, an author can also specify name and value arguments directly using
For the The Here's a more complete example, e.g., for a login prompt:
General form field attributes
(:input select ... :)The basic form of a select box is a sequence of options:
The values can be specified positionally:
We can specify the size of the selection box:
You can specify a multiple select box (only the first item needs to have "size=3 multiple" attributes):
To have an element selected, use Note that to have two select boxes inline, not only should you give them different
Note, in the HTML output, only the attributes (:input datalist ... :)This allows a number of values (suggestions) to appear in a drop-down menu allowing the user to select one of the values or to fill a new, different value. The markup accepts named or positional attributes: An existing The datalist element is invisible and can be anywhere in the page. The suggestion menu appears when the user starts typing in the attached text field and filters the suggested values that contain the letters typed in the text field.
This is a recent addition to the HTML standard, see https://caniuse.com/#feat=datalist for current browser support. Note that if you have a datalist element immediately following another datalist element, not only should you give them differentid= attributes, but also place a separator, like a character, or the null sequence [==] between them: (:input datalist dl_1 First:) (:input datalist dl_1 Second:)[==] (:input datalist dl_2 First:) (:input datalist dl_2 Second:) (:input pmtoken:)This includes a unique session identifier as a hidden input field to prevent cross-site request forgeries (CSRF). Can be included in custom forms, and the custom action handlers receiving the form can check if the request is valid by calling pmtoken(1). The "name" of the HTML input element, by default 'pmtoken', can be changed by setting for example See Also
Compatible recipes:
This page may have a more recent version on pmwiki.org: PmWiki:Forms, and a talk page: PmWiki:Forms-Talk.
|
||||||||||||||||||||
Le contenu du site GratiLab, laboratoire de recherche conviviale sur la gratuité, le DIY et la culture libre, sauf mentions contraires, ainsi que toute nouvelle contribution à ce site, est sous licence culturelle non-marchande.
Site gratuit, sans publicité, à but non lucratif, ouvert à tous ceux qui souhaitent effectuer des recherches sur les échanges non-marchands et la culture libre ou simplement partager leurs savoirs et savoirs-faire. Construit avec PmWiki. |