Form.Fields
Summary
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("Form.Fields") {
<td> @item.GetValue("Relevant.Tag") </td>
}
</tr>
</table>
Check if the loop exists
@if (Loops.Contains("Form.Fields")) {
...
}
Example of usage
The following general example illustrates how to use a loop construct.
<table>
<!--@LoopStart(Form.Fields)-->
<tr>
<td><!--@Loop:Tag--></td>
</tr>
<!--LoopEnd(Form.Fields)-->
</table>
Check if the loop exists
<!--@If LoopDefined(Form.Fields)-->
...
<!--@EndIf(Form.Fields)-->
Available tags
Returns the value "True
" if the field is active.
RAZOR
@GetString("Field.Active")
HTML
<!--@Field.Active-->
Returns the value "Checked
" if a check box by default is checked in the form.
RAZOR
@GetString("Field.Checked")
HTML
<!--@Field.Checked-->
Contains the HTML needed for rendering the field type, e.g. like this: <input type="checkbox" checked="checked" id="ManualForm_Checkbox" name="ManualForm_Checkbox" value="" />
RAZOR
@GetString("Field.Control")
HTML
<!--@Field.Control-->
Returns the default value of a field.
RAZOR
@GetString("Field.DefaultValue")
HTML
<!--@Field.DefaultValue-->
Returns a description of the field.
RAZOR
@GetString("Field.Description")
HTML
<!--@Field.Description-->
Returns the height of the field in frontend.
RAZOR
@GetInteger("Field.Height")
HTML
<!--@Field.Height-->
Returns the maximum length of the field input.
RAZOR
@GetString("Field.MaxLength")
HTML
<!--@Field.MaxLength-->
Returns the field name.
RAZOR
@GetString("Field.Name")
Returns the value "True" if the field is required.
RAZOR
@GetString("Field.Required")
HTML
<!--@Field.Required-->
Returns the system name of the field.
RAZOR
@GetString("Field.Systemname")
HTML
<!--@Field.Systemname-->
Returns the field type.
RAZOR
@GetString("Field.Type")
Returns the current field type.
RAZOR
@GetString("Field.Type.TextInput")
HTML
<!--@Field.Type.TextInput-->
Returns the current value of the field.
RAZOR
@GetString("Field.Value")
Returns the width of the field in frontend.
RAZOR
@GetInteger("Field.Width")
Available loops
The FieldOptions loop lets you display information about related the field options for the fields of type Radio button or Dropdown.
RAZOR
@foreach (LoopItem item in GetLoop("FieldOptions")){
<p>@item.GetValue("TagName")</p>
}
HTML
<!--@LoopStart(FieldOptions)-->
<p>@TagName</p>
<!--@LoopEnd(FieldOptions)-->