(One intermediate revision by the same user not shown)
Line 18: Line 18:
 
<_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--</option>
+
     <_input type="option" value="">--Please choose an option--</_input>
     <_input type="option" value="dog">Dog</option>
+
     <_input type="option" value="dog">Dog</_input>
     <_input type="option" value="cat">Cat</option>
+
     <_input type="option" value="cat">Cat</_input>
     <_input type="option" value="hamster">Hamster</option>
+
     <_input type="option" value="hamster">Hamster</_input>
     <_input type="option" value="parrot">Parrot</option>
+
     <_input type="option" value="parrot">Parrot</_input>
     <_input type="option" value="spider">Spider</option>
+
     <_input type="option" value="spider">Spider</_input>
     <_input type="option" value="goldfish">Goldfish</option>
+
     <_input type="option" value="goldfish">Goldfish</_input>
</select>
+
</_select>
 
</syntaxhighlight>
 
</syntaxhighlight>
 
<_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--</option>
+
     <_input type="option" value="">--Please choose an option--</_input>
     <_input type="option" value="dog">Dog</option>
+
     <_input type="option" value="dog">Dog</_input>
     <_input type="option" value="cat">Cat</option>
+
     <_input type="option" value="cat">Cat</_input>
     <_input type="option" value="hamster">Hamster</option>
+
     <_input type="option" value="hamster">Hamster</_input>
     <_input type="option" value="parrot">Parrot</option>
+
     <_input type="option" value="parrot">Parrot</_input>
     <_input type="option" value="spider">Spider</option>
+
     <_input type="option" value="spider">Spider</_input>
     <_input type="option" value="goldfish">Goldfish</option>
+
     <_input type="option" value="goldfish">Goldfish</_input>
</select>
+
</_select>
 
===Note===
 
===Note===
+
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 5: Line 5:
 
|Doc sort order=110
 
|Doc sort order=110
 
|Doc target group=User
 
|Doc target group=User
 +
|Doc synopsis=How to render an option input field. Mostly used within the input select fields.
 
}}
 
}}

Latest revision as of 14:56, 22 September 2022

Name

option

Type

_input

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

_input type="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.


Example

Using options with select:

<_label for="pet-select">Choose a pet:</_label>
<_select name="pets" id="pet-select">
    <_input type="option" value="">--Please choose an option--</_input>
    <_input type="option" value="dog">Dog</_input>
    <_input type="option" value="cat">Cat</_input>
    <_input type="option" value="hamster">Hamster</_input>
    <_input type="option" value="parrot">Parrot</_input>
    <_input type="option" value="spider">Spider</_input>
    <_input type="option" value="goldfish">Goldfish</_input>
</_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.