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

Containers allowing multiple selector matches #9

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

treyhunner
Copy link

This change allows the form field selector to match multiple elements with a common parent selector that contains the target counter element.

For example this Javascript:

$('.my-field').simplyCountable(
    counter: '.my-counter',
    container: '.my-container',
    maxCount: 30
});

Would work as expected with this markup:

<div class="my-container">
First Name: (limit <span class="my-counter"></span> characters): 
<input name="first_name" class="my-field">
</div>
<div class="my-container">
Last Name: (limit <span class="my-counter"></span> characters): 
<input name="last_name" class="my-field">
</div>
<div class="my-container">
Email: (limit <span class="my-counter"></span> characters): 
<input name="email" class="my-field">
</div>

Diff with whitespace differences ignored.

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

Successfully merging this pull request may close these issues.

1 participant