Field.Placeholder

Version: - string  

Summary

Returns the placeholder text for the field. The placeholder is used to specify a short hint that describes the expected value of an input field (e.g. a sample value or a short description of the expected format).

The short hint is displayed in the input field before the user enters a value

Settings

The value is based on the Placeholder field in the field settings.

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

Remarks

Works only with text fields.

Examples

Outputting the template tag

@GetString("Field.Placeholder")

Check if tag has a value

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

Assign tag to a value for later use

@{ string storedTag = GetString("Field.Placeholder"); }

Outputting the template tag

<!--@Field.Placeholder-->

Check if string has a value

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