Skip to content

Field name is not being rendered for inputs in default theme #1428

@lesley-w

Description

@lesley-w

Which Umbraco Forms version are you using? (Please write the exact version, example: 13.4.0)

v13.5.0

Which Umbraco version are you using? (Please write the exact version, example: 13.5.2)

v13.9.2

Issue summary

The default fieldtype partials do not render the field alias, they render the Guid - which makes it really hard to retrieve an input field in javascript.

Looking at the partials code, eg for textarea, it renders

<textarea class="@Html.GetFormFieldClass(Model.FieldTypeName)" name="**@Model.Name**" id="@Model.Id" data-umb="@Model.Id" rows="@numberOfRows". .... etc but @Model.Name appears to be being set to the id of the field not the alias. <textarea class="" name="4609739d-0e57-44bf-bfaf-a8c68fef64a2" id="4609739d-0e57-44bf-bfaf-a8c68fef64a2" data-umb="4609739d-0e57-44bf-bfaf-a8c68fef64a2" rows="3" cols="20" data-val="true" data-val-required="This is a required field" aria-required="true"></textarea>

Specifics

No response

Steps to reproduce

Install Umbraco Forms v13.5 in Umbraco v13.9.2.
Create a form
Render form and check the html being generated
Inputs will have name value as a Guid not the name/alias

Expected result / actual result

Model.Name should be set to the field's alias not the id. Or add a new data-alias attribute to display the alias.

<textarea class="" name="description" id="4609739d-0e57-44bf-bfaf-a8c68fef64a2" data-umb="4609739d-0e57-44bf-bfaf-a8c68fef64a2" rows="3" cols="20" data-val="true" data-val-required="This is a required field" aria-required="true"></textarea>

or

<textarea class="" name="4609739d-0e57-44bf-bfaf-a8c68fef64a2" id="4609739d-0e57-44bf-bfaf-a8c68fef64a2" data-umb="4609739d-0e57-44bf-bfaf-a8c68fef64a2" rows="3" cols="20" data-alias="description" data-val="true" data-val-required="This is a required field" aria-required="true"></textarea>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions