Field.MaxLength

Version: - integer  

Summary

Returns the maximum number of characters that the field allows.

Settings

The value is based on the Max. lenght field in the Values settings for the field.

(Modules > Forms for editors > Form > Edit field > Values > Values > Max. lenght)

Examples

Outputting the template tag

@GetInteger("Field.MaxLength")

Check if tag has a value

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

Assign tag to a value for later use

@{ int storedTag = GetInteger("Field.MaxLength"); }

Outputting the template tag

<!--@Field.MaxLength-->

Check if integer has a value

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