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

Using data-rule attributes for validation rules #2482

Closed
sgdowney opened this issue Feb 27, 2024 · 1 comment
Closed

Using data-rule attributes for validation rules #2482

sgdowney opened this issue Feb 27, 2024 · 1 comment

Comments

@sgdowney
Copy link

sgdowney commented Feb 27, 2024

Your environment

  • Version of jquery-validate: current version
  • Browser name and version:

Not so much a bug as a suggestion.

Current behavior

When using attributes to specify the require_from_groups or skip_or_fill_minimum validations, the attribute names contain underscores.
data-rule-require_from_groups=
data-rule-skip_or_fill_minimum=
I believe there is a recommendation to avoid using underscores in attribute names and use dashes instead.

Expected behavior

The suggested attribute names would change to
data-rule-require-from-groups=
data-rule-skip-or-fill-minimum=

Live demo

@bytestream
Copy link
Member

I don't believe this is correct, underscores are permitted. https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/dataset

The attribute name begins with data-. It can contain only letters, numbers, dashes (-), periods (.), colons (:), and underscores (_). Any ASCII capital letters (A to Z) are converted to lowercase.

@bytestream bytestream closed this as not planned Won't fix, can't repro, duplicate, stale Apr 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants