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

get value from specific input #755

Closed
donny26utama opened this issue Nov 30, 2022 · 1 comment
Closed

get value from specific input #755

donny26utama opened this issue Nov 30, 2022 · 1 comment

Comments

@donny26utama
Copy link

<input type="text" id="input-1" class="input-auto-numeric">
<input type="text" id="input-2" class="input-auto-numeric">
new AutoNumeric.multiple(".input-auto-numeric");

how to get unformatted value from input-1 ??

@AlexandreBonneau
Copy link
Member

Hi, we recommend using our Gitter chat for asking questions.
The Github issue tracker is for bugs and feature requests only.

That said, you can access the unformatted value from input-1 using:

let yourValue = AutoNumeric.getAutoNumericElement('#input-1').getNumericString();
// Be sure to check if the html element is loaded and exist before doing that

The better way would be to save a reference to the generated AutoNumeric elements array when using new AutoNumeric.multiple() (see the doc), so that you can then access the object directly, using:

let ANelements = new AutoNumeric.multiple(".input-auto-numeric");
let yourValue = ANelements[0].getNumericString();

@AlexandreBonneau AlexandreBonneau closed this as not planned Won't fix, can't repro, duplicate, stale Mar 6, 2023
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