For more information... RTFM!
NAVIGATION
PAGES THAT LINK HERE
ACCOUNT LOGIN

You are not logged in

Powered by Interchange version 5.7.0

selected

This tag provides a "memory" for HTML <select> option lists.

Summary

  • [selected name value]

Parameter Description Default
name The name of the CGI/value. None
value The value to test against. None
default Specify that this option should be marked as "selected" if the named value variable is not set at all. None
case Make the value check case sensitive. No
cgi Use the volatile $CGI space instead of the $Values space. No
multiple Check for multiple (stacked) values, separated by an ASCII NUL character. No

Example

Tag expansion example

[value name="example" set="foo"]

<select name="example">
    <option value="foo"[selected name="example" value="foo"]>foo</option>
    <option value="bar"[selected name="example" value="bar"]>foo</option>
</select>
<select name="example">
    <option value="foo" selected="selected">foo</option>
    <option value="bar">foo</option>
</select>

Description

This tag provides a "memory" for HTML <select> option lists.  The similar [checked] tag does the same, but for the HTML radio buttons and checkboxes.

<option value="foo"[selected name="example" value="foo"]>foo</option>
<option value="bar"[selected name="example" value="bar"]>foo</option>

This will output "selected="selected"" if the "foo" value is equal to the specified value parameter.  The match will not be case sensitive unless the optional case=1 parameter is used.

Use the default parameter to specify that this option should be marked "selected" if the named value variable is not set at all.

Parameters

name

The name of the CGI/value.

value

The value to test against.

default

Specify that this option should be marked as "selected" if the named value is not set at all.

case

Set to a true value to perform case-sensitive matches.

cgi

By default, the $Values space (i.e. [value foo]) is selected.  Use this parameter if you want to use the volatile $CGI space (i.e. [cgi foo]).

multiple

Check for multiple (stacked) values, separated by an ASCII NUL character ("\0" in Perl).

Category:  Interchange tags
Last modified by: Kevin Walsh
Modification date: Wednesday 26 September 2007 at 6:33 PM (CDT)
Home  |  Legal nonsense  |  Privacy policy  |  Donations  |  Contact us