Index  Up  <<  >>  


Checks and Selections

You can provide a ``memory'' for drop-down menus, radio buttons, and checkboxes with the [checked] and [selected] tags.

[checked var_name value]
named attributes: [checked name=``var_name'' value=``value'' multiple=0|1 default=0|1]

This will output CHECKED if the variable var_name is equal to value. Not case sensitive.

As of 3.11: If the multiple attribute is defined and set to a non-zero value (1 is implicit) then if the value matches on a word/non-word boundary it will be CHECKED. If the default attribute is set to a non-zero value, then the box will be checked if the variable var_name is empty or zero.

[selected var_name value MULTIPLE*]
named attributes: [selected name="var_name" value="value" multiple="yes"]

This will output SELECTED if the variable var_name is equal to value. If the optional MULTIPLE argument is present, it will look for any of a variety of values. Not case sensitive.

Here is a drop-down menu that remembers an item-modifier color selection:

    <SELECT NAME="color">
    <OPTION [selected color blue]> Blue
    <OPTION [selected color green]> Green
    <OPTION [selected color red]> Red
    </SELECT>

Here is the same thing, but for a shopping-basket color selection

    <SELECT NAME="[modifier-name color]">
    <OPTION [selected [modifier-name color] blue]> Blue
    <OPTION [selected [modifier-name color] green]> Green
    <OPTION [selected [modifier-name color] red]> Red
    </SELECT>


Index  Up  <<  >>