(8 intermediate revisions by the same user not shown)
Line 2: Line 2:
 
option
 
option
 
===Type===
 
===Type===
_input
+
option
 
===Synopsis===
 
===Synopsis===
 
How to render an option input field. Mostly used within the input select fields.
 
How to render an option input field. Mostly used within the input select fields.
 
===Description===
 
===Description===
The <option> HTML element is used to define an item contained in a <select>, an <optgroup>, or a <datalist> element. As such, <option> can represent menu items in popups and other lists of items in an HTML document.
+
The < option > HTML element is used to define an item contained in a < select >, an < optgroup >, or a < datalist > element. As such, < option > can represent menu items in popups and other lists of items in an HTML document.
  
 
===Parameters===
 
===Parameters===
_input type="option". All valid HTML5 attributes are supported.  
+
< option >. All valid HTML5 attributes are supported.  
There is one specific FlexForm parameter '''nohtmldecode'''. By default all values of an option input will be html decoded to get rid of special characters. To turn this off just add '''nohtmldecode''' as an argument to the option field.
+
There is a specific FlexForm parameter '''nohtmldecode'''. By default all values of an option input will be html decoded to get rid of special characters. To turn this off just add '''nohtmldecode''' as an argument to the option field. Options have by default comma separated values when adding to a Template. You can specify a different separator using the argument '''separator'''. e.g. separator=";".
  
  
Line 16: Line 16:
 
Using options with select:
 
Using options with select:
 
<syntaxhighlight lang="html">
 
<syntaxhighlight lang="html">
<_label for="pet-select">Choose a pet:</_label>
+
<label for="pet-select">Choose a pet:</label>
<_select name="pets" id="pet-select">
+
<select name="pets" id="pet-select">
     <_input type="option" value="">--Please choose an option--</_input>
+
     <option value="">--Please choose an option--</option>
     <_input type="option" value="dog">Dog</_input>
+
     <option value="dog">Dog</option>
     <_input type="option" value="cat">Cat</_input>
+
     <option value="cat">Cat</option>
     <_input type="option" value="hamster">Hamster</_input>
+
     <option value="hamster">Hamster</option>
     <_input type="option" value="parrot">Parrot</_input>
+
     <option value="parrot">Parrot</option>
     <_input type="option" value="spider">Spider</_input>
+
     <option value="spider">Spider</option>
     <_input type="option" value="goldfish">Goldfish</_input>
+
     <option value="goldfish">Goldfish</option>
</_select>
+
</select>
 
</syntaxhighlight>
 
</syntaxhighlight>
<_label for="pet-select">Choose a pet:</_label>
+
 
<_select name="pets" id="pet-select">
+
 
     <_input type="option" value="">--Please choose an option--</_input>
+
<label for="pet-select">Choose a pet:</label>
     <_input type="option" value="dog">Dog</_input>
+
<select name="pets" id="pet-select">
     <_input type="option" value="cat">Cat</_input>
+
     <option value="">--Please choose an option--</option>
     <_input type="option" value="hamster">Hamster</_input>
+
     <option value="dog">Dog</option>
     <_input type="option" value="parrot">Parrot</_input>
+
     <option value="cat">Cat</option>
     <_input type="option" value="spider">Spider</_input>
+
     <option value="hamster">Hamster</option>
     <_input type="option" value="goldfish">Goldfish</_input>
+
     <option value="parrot">Parrot</option>
</_select>
+
     <option value="spider">Spider</option>
 +
     <option value="goldfish">Goldfish</option>
 +
</select>
 +
 
 
===Note===
 
===Note===
 
See also '''input/select''' from the menu on the right
 
See also '''input/select''' from the menu on the right
 
===Links===
 
===Links===
 
See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/option for all the details.
 
See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/option for all the details.
ws-class-props
Line 1: Line 1:
 
{{Doc properties
 
{{Doc properties
|Subject version=2.0
+
|Subject version=2.0,2.1
 
|Doc subject=DevOps:Doc/FlexForm
 
|Doc subject=DevOps:Doc/FlexForm
 
|Doc parent=DevOps:Doc/FlexForm/1.0/input
 
|Doc parent=DevOps:Doc/FlexForm/1.0/input

Latest revision as of 11:21, 3 April 2023

Name

option

Type

option

Synopsis

How to render an option input field. Mostly used within the input select fields.

Description

The < option > HTML element is used to define an item contained in a < select >, an < optgroup >, or a < datalist > element. As such, < option > can represent menu items in popups and other lists of items in an HTML document.

Parameters

< option >. All valid HTML5 attributes are supported. There is a specific FlexForm parameter nohtmldecode. By default all values of an option input will be html decoded to get rid of special characters. To turn this off just add nohtmldecode as an argument to the option field. Options have by default comma separated values when adding to a Template. You can specify a different separator using the argument separator. e.g. separator=";".


Example

Using options with select:

<label for="pet-select">Choose a pet:</label>
<select name="pets" id="pet-select">
    <option value="">--Please choose an option--</option>
    <option value="dog">Dog</option>
    <option value="cat">Cat</option>
    <option value="hamster">Hamster</option>
    <option value="parrot">Parrot</option>
    <option value="spider">Spider</option>
    <option value="goldfish">Goldfish</option>
</select>


Note

See also input/select from the menu on the right

Links

See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/option for all the details.