LassoScript Utility
Basics Browse Detail


Tag Link -Token Category Utility
Type Command Source Available No
Support Preferred Version 2.5
Change Unchanged Data Source Any
Output Type None 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


-Token defines a named token. This tag is unique among Lasso's command tags. It requires two parameters, the name of the token which is to be defined and the value for the token.

The name is specified after the -Token tag followed by a period. -Token.First_Name defines a token named First_Name or -Token.34 defines a token named 34.

The value is specified in the same fashion as the value for any command tag. -Token.First_Name=John would set the token First_Name to the value John. -Token.34=Hello would set the token 34 to the value Hello.

The value for a named token can be retrieved using the [Token_Value] tag. For example, [Token_Value: 'First_Name'] or [Token_Value: '34']. The value for a token can only be retrieved in the response page to an HTML form or URL based action which includes a -Token command tag or within the [Inline] ... [/Inline] tags if the opening [Inline] includes a -Token command tag among its parameters.

In order to store and retrieve values within a single format file the [Variable] tag should be used instead.

By simply specifying -Token=Value a single unnamed token can be created whose value can be retrieved with [Token_Value].


[Inline: -Token.Name=Value, ...]

<a href="default.lasso?-Token.Name=Value&...">Link</a>

<form action="default.lasso" method="POST">
  <input type="hidden" name="-Token.Name" value="Value">


Required Parameters
Value The value of the token which is to be set.
Optional Parameters
Name The name of the token which is to be set.


To define a token within an HTML form:

Use the -Token command tag within a hidden input. The following example defines a token named First_Name and a token named Last_Name within an HTML form. The values for these tokens can be retrieved in the response page to this form using [Token_Value: 'First_Name'] and [Token_Value: 'Last_Name']

<form action="response.lasso" method="POST">
  <input type="hidden" name="-Token.First_Name" value="John">
  <input type="hidden" name="-Token.Last_Name" value="Doe">
  <input type="submit" name="-Nothing" value="Submit Form">