Positional parameters in same order.
The attribute hash reference is passed to the subroutine after the parameters as the last argument. This may mean that there are parameters not shown here.
Must pass named parameter interpolate=1 to cause interpolation.
Invalidates cache: no
Called Routine:
ASP/perl tag calls:
$Tag->error( { name => VALUE, } ) OR $Tag->error($name, $ATTRHASH);
[error var options] var is the error name, e.g. "session"
The [error ...] tag is designed to manage form variable checking for the
Minivend submit
form processing action. It works in conjunction with the definition set in mv_order_profile
, and can generate error messages in any format you desire.
If the variable in question passes order profile checking, it will output a label, by default bold text if the item is required, or normal text if not (controlled by the <require> parameter. If the variable fails one or more order checks, the error message will be substituted into a template and the error cleared from the user's session.
(Below is as of 4.03, the equivalent in 4.02 is [if type=explicit compare=``[error all=1 keep=1]''] ... [/if].)
To check errors without clearing them, you can use the idiom:
[if errors] <FONT SIZE="+1" COLOR=RED> There were errors in your form submission. </FONT> <BLOCKQUOTE> [error all=1 show_error=1 joiner="<BR>"] </BLOCKQUOTE> [/if]
The options are:
text=<optional string to embed the error message(s)
in>
place a ``%s'' somewhere in 'text' to mark where you want the error message placed, otherwise it's appended on the end. This option also implies show_error.
show_error=1 show_error=1 means return the error message text; otherwise just the number of errors found is returned.
used with 'required' to display a standardized error format. The HTML formating can bet set via the global variable MV_ERROR_STD_LABEL with the default being:
<FONT COLOR=RED>label_str<SMALL><I>(%s)</I></SMALL></FONT>
where <label_str> is what you set std_label to and %s
is
substituted with the error message. This option can not be used with the
text= option.