Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Toutouwai opened this issue Oct 7, 2024 · 0 comments

Comments

@Toutouwai
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant