ValidationErrors
Summary
The ValidationErrors
loop lets you display validation errors for fields in the order.
Examples
Basic usage
Notice the use of @item.GetValue to get data from the loop variable.
If you just write @GetValue, the data will be taken from outside the loop.
Similarly, you have to use @item.GetLoop to use loops inside a loop.
<table>
<tr>
@foreach (LoopItem item in GetLoop("ValidationErrors") {
<td> @item.GetValue("Relevant.Tag") </td>
}
</tr>
</table>
Check if the loop exists
@if (Loops.Contains("ValidationErrors")) {
...
}
Example of usage
The following general example illustrates how to use a loop construct.
<table>
<!--@LoopStart(ValidationErrors)-->
<tr>
<td><!--@Loop:Tag--></td>
</tr>
<!--LoopEnd(ValidationErrors)-->
</table>
Check if the loop exists
<!--@If LoopDefined(ValidationErrors)-->
...
<!--@EndIf(ValidationErrors)-->
Available tags
Ecom:Cart.ValidationError.ErrorMessage
Returns the validation error message associated with the particular field.
RAZOR
@GetString("Ecom:Cart.ValidationError.ErrorMessage")
Ecom:Cart.ValidationError.FieldName
Returns the name of the current field which is being validated.
RAZOR
@GetString("Ecom:Cart.ValidationError.FieldName")
Ecom:Cart.ValidationError.FieldSystemName
Returns the system name of the field which is being validated.
RAZOR
@GetString("Ecom:Cart.ValidationError.FieldSystemName")