Jquery : autoNumeric.js Remove Formatting Number at submit

742 Views Asked by At

I use this autoNumeric.js plugin to formatting number at typing in textfield. Everything is fine , i can see the number is formatted at i typing. But the problem is, every i submit form , the number still formatted.

How to remove formatted number at submit form ?

Source Code

jQuery(document).ready(function ($) {
  $("#meteranFormat").autoNumeric("init", {
    unformatOnSubmit: true,
  });
});

enter image description here

*note , i dont know if this plugin deprecated or not.

1

There are 1 best solutions below

0
On

First and foremost, the AutoNumeric version you are using is deprecated for about 6 years. It would be better to use the newer version described on docs.autonumeric.org.

With that version, you do not need the jQuery dependency anymore, and to remove the format while submitting the form, you can use formSubmitNumericString() (see all the form-related functions).