Jquery autoNumeric set a label

4.1k Views Asked by At

I want to set the value of a label with autoNumeric but it is not setting the value I tried it like this

$('#lblTotal').autoNumeric(data.total);

but it is not setting the value anyOne used it ???

2

There are 2 best solutions below

0
dnxit On BEST ANSWER

This is how I should have set the value with autoNumeric but I was not calling 'init'

$('#lblTotal').autoNumeric('init');
$('#lblTotal').autoNumeric('set', data.total);

To get value with autoNumeric

$('#lblTotal').autoNumeric('get');
0
hsuk On

Try:

$('#lblTotal').autoNumeric('set', data.total);

See the link for more info : autoNumeric 1.9.18