Field.Required

Version: - boolean  

Summary

Returns True if the field is required.

Settings

The value is generated automatically but is based on the selection in the Required field in the field settings.

(Modules > Forms for editors > Form > Edit field > Settings > Required)

Examples

Outputting the template tag

@GetBoolean("Field.Required")

Check if tag has a value

@if(!bool.IsNullOrWhiteSpace(GetBoolean("Field.Required"))) { @* Tag has value, so let's do something useful here. *@ }

Assign tag to a value for later use

@{ bool storedTag = GetBoolean("Field.Required"); }

Outputting the template tag

<!--@Field.Required-->

Check if boolean has a value

<!--@If Defined(@Field.Required)--> Let's output this tag here: <strong><!--@Field.Required--></strong> <!--@EndIf(@Field.Required)-->