LassoScript Utility
Basics Browse Detail

[Selected]

Tag Link [Selected] Category Database
Type Substitution Source Available No
Support Preferred Version 2.5
Change Unchanged Data Source FileMaker Pro
Output Type String Security None
Implementation LCAPI Sets Lasso 8.5, Lasso 8.0, Lasso 7.0, Lasso 6.0, Lasso 5.0, Lasso 3.x, Lasso 2.5

Description

[Selected] displays the word "selected" if the current value list item is selected in the field assocated with the value list.

This tag should be used within [Value_List] ... [/Value_List] tags to place the "selected" parameter within HTML <option> tags for select lists or pop-up menus.

Syntax

<select name="Field_Name">
  [Value_List: 'Field Name']
    <option value="[Value_ListItem]" [Selected]>
      [Value_ListItem] 
    </option>
  [/Value_List]
</select>

Parameters

No Parameters Required.

Examples

To display an HTML pop-up menu for a FileMaker field with an associated value list:

Use the [Value_List] ... [/Value_List] and [Value_ListItem] tags to generate a pop-up menu with the appropriate values and the [Selected] to ensure that the proper menu items are selected, based upon the current field values.

The following example creates a pop-up menu for the Favorite_Color field. The results show Yellow selected as the favorite color.

<select name="Favorite_Color">
  [Value_List: 'Favorite_Color']
    <option value="[Value_ListItem]" [Selected]> 
      [Value_ListItem]
    </option>
  [/Value_List]
</select>

<select name="Favorite_Color">
    <option value="Red"> 
      Red
    </option>
    <option value="Blue"> 
      Red
    </option>
    <option value="Yellow" Selected> 
      Red
    </option>
</select>

<:br><input type="checkbox" name="Favorite_Color"
    value="Red"> Red
<:br><input type="checkbox" name="Favorite_Color"
    value="Blue"> Blue
<:br><input type="checkbox" name="Favorite_Color"
    value="Yellow" checked> Yellow