Skip to content

Add New Field: validate field name before submission, to avoid losing other form valuesΒ #544

@Toutouwai

Description

@Toutouwai

Short description of the enhancement

Similar to this resolved issue, when the field name that's entered into the Add New Field form is not allowed, all the existing values in the form are lost. This is rather aggravating if you have spent time filling in label, type, description, notes and icon.

It would be nice if the field name could be checked before the form is submitted. I've made a simple module that checks the field name via AJAX: https://github.com/Toutouwai/AddFieldValidateName

validate

The core could adopt a similar AJAX-driven approach, or seeing as the name input already does some partial validation and correction this could be enhanced with more client-side validation, e.g. there could be JS arrays with the reserved words, existing field names and language names and the entered value could be checked against those before submission.

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