4.86. value
Returns the the current value of the named form input field. HTML-escapes Interchange tags in the result for security.
Can also set a new value within the current page.
4.86.1. Summary
[value name] [value name=form_var_name other_named_attributes]
Parameters | Description | Default |
name | This is the name of the form variable whose value you want. | None |
Attributes | Default |
set | none |
hide | No |
filter | none |
keep (with filter) | No |
scratch | No |
default | none |
enable_html | No |
interpolate (reparse) | No |
Other_Characteristics | |
Invalidates cache | Yes |
Tag expansion example:
Assuming form variable 'foo' = 'bar',
[value foo] --- bar
ASP-like Perl call:
$Tag->value( { name => var_name } ); # or if you simply want the value: $Values->{var_name};
or similarly with positional parameters,
$Tag->value($name, $attribute_hash_reference);
4.86.2. Description
Usage example:
<INPUT TYPE="text" NAME="name" VALUE="[value name]"> <INPUT TYPE="text" NAME="name" VALUE="[value name=name]">
Expands into the current value of the named customer/form input field. When the value is returned, any Interchange tags present in the value will be escaped. This prevents users from entering Interchange tags in form values, which would be a serious security risk.
4.86.2.1. name
This is the name of the form variable whose value you want.
4.86.2.2. set
You can change a value with 'set=new_value'. The tag will return the value you set unless you also set the hide=1 attribute.
Use this to "uncheck" a checkbox or set other form variable values to defaults. If you simply want a place to store your own data, use the set and scratch tags instead.
Note that this is only available in new-style tags, for safety reasons.
4.86.2.3. hide
Setting hide=1 suppresses the tag's return value, which can be useful with the set attribute.
4.86.2.4. filter
See the filter tag for a list of filters.
Setting 'filter="filter"' modifies the named value with the specified filter.
4.86.2.5. keep (with filter)
Set keep=1 if you want the tag to return a filtered result but do not want the filter to modify the form value itself in the $::Values hash.
4.86.2.6. scratch
Setting 'scratch=1' places a copy of the value in the $::Scratch hash. An illustrative example:
foo is [value name=foo scratch=1] in the Values hash foo is now also [scratch foo] in the Scratch hash
4.86.2.7. default
This sets a return value in case the named value is missing or otherwise false. The following will expand to "Using default":
[value name=myname set=0 hide=1] [value name=myname default="Using default"]
4.86.2.8. enable_html
Any '<' characters will normally be converted into '<' for safety reasons. This conversion can be disabled using 'enable_html=1'.