Skip to content

Validation failed message not displayed when the form field name has uppercase letters #7

@jankulma-turbine

Description

@jankulma-turbine

Hi,

When you set a form field to have a name with uppercase letters, eg. "filePDF", the data-name attribute of the input field is generated like so: data-name="field__file-p-d-f".

When the form is invalid, and an error is returned, its returned using form field name ("filePDF") as index (https://github.com/b2bcodext/cms-form-builder/blob/release/2.0/src/B2bCode/Bundle/CmsFormBundle/Controller/Frontend/AjaxFormController.php#L75), but in https://github.com/b2bcodext/cms-form-builder/blob/release/2.0/src/B2bCode/Bundle/CmsFormBundle/Resources/public/js/app/components/form-component.js#L83 we are looking for the element by data-name (which is "file-p-d-f"), not name, and we end up not finding the element, therefore not showing the error message.

JK

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions