Form.Field.[FieldSystemName].HtmlId
Version: - stringSummary
Returns an ID that can be used as ID attribute.
Settings
The value is based on the System name field in the Layout settings for the field.
(Modules > Forms for editors > Form > Edit field > Layout > Advanced > System name)
Examples
Outputting the template tag
@GetString("Form.Field.[FieldSystemName].HtmlId")
Check if tag has a value
@if(!string.IsNullOrWhiteSpace(GetString("Form.Field.[FieldSystemName].HtmlId"))) {
@* Tag has value, so let's do something useful here. *@
}
Assign tag to a value for later use
@{
string storedTag = GetString("Form.Field.[FieldSystemName].HtmlId");
}
Outputting the template tag
<!--@Form.Field.[FieldSystemName].HtmlId-->
Check if string has a value
<!--@If Defined(@Form.Field.[FieldSystemName].HtmlId)-->
Let's output this tag here: <strong><!--@Form.Field.[FieldSystemName].HtmlId--></strong>
<!--@EndIf(@Form.Field.[FieldSystemName].HtmlId)-->