1

I made an input-control of an input field with "auto numeric". AutoNumeric Website

It works well in normal mode, but when I load the content (with form) live through ajax it does not work. Do somebody have an idea?

jQuery(function($) {
    $('.price').autoNumeric('init');
});
Will Ray
  • 10,621
  • 3
  • 46
  • 61
DragonStyle
  • 145
  • 11

2 Answers2

0

Use update method

$('#sum-1').autoNumeric("update" ,{});
mydreamadsl
  • 568
  • 4
  • 16
  • 25
0

First, I'd suggest using the latest v4 which has seen a LOT of improvement since the old 1.9 era.

Second, since you are I imagine directly updating the input value via another script, you need to make AutoNumeric aware of this change. The best way to do that is to use the element set() function to set the new value. Example :

const newValue = ajaxCall();
aNElement.set(newValue);

...and you're done ;)

Alex
  • 1,241
  • 13
  • 22