Skip to content

multiple same class element didn't work #209

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

Closed
xiangice opened this issue Aug 2, 2017 · 3 comments
Closed

multiple same class element didn't work #209

xiangice opened this issue Aug 2, 2017 · 3 comments

Comments

@xiangice
Copy link

xiangice commented Aug 2, 2017

<input name="aaa" type="text" value="" class="input-number">
<input name="bbb" type="text" value="" class="input-number">
<input name="ccc" type="text" value="" class="input-number">

var cleave = new Cleave('.input-number', {`
           numeral: true
  });

just first input is working.

@nosir
Copy link
Owner

nosir commented Aug 21, 2017

You need a loop to assign instance for each of them.
Basically each instance only applies to one input field, so you can run instance.getRawValue() to get raw value for specific input field.
Please check this: #138

@nosir nosir closed this as completed Aug 21, 2017
@iofacture
Copy link

I really like your JS library. Its very straightforward, easy to understand, and for the most part easy to use, But this issue is more than a little annoying - I feel like this is something that should be addressed as it seems to be something that comes up for a lot of your users. Is there some fundamental design reason the library can't be made to handle this without requiring the end user to loop over their inputs?

@nosir
Copy link
Owner

nosir commented Jun 29, 2019

@iofacture I will think about what's the best way to do this, issue created, thanks

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

3 participants