Search code examples
javascriptjspautonumber

autoNumeric not working as expected


alert($('input[type=text]#A_CLAIM_AMT1').val());
$('input[type=text]#A_CLAIM_AMT1').autoNumeric('init',{vMin:'0.00',vMax:'99999999999.99',aSign:'',aSep:',',aPad: false,mDec:'2',aDec:'.'});
alert($('input[type=text]#A_CLAIM_AMT1').val());

I am using jsp, when I send the request to the server with the value of A_CLAIM_AMT1 = 555,555 ... some server side validations are done and then the response is returned back to the jsp with the same fields values ... so the first alert prints 555,555 .... but the second returns 555.56 which is finally printed as the field value


Solution

  • I was able to fix it adding :

    aForm: false
    

    thus:

    $('input[type=text]#A_CLAIM_AMT1').autoNumeric('init',{vMin:'0.00',vMax:'99999999999.99',aSign:'',aSep:',',aPad: false,mDec:'2',aDec:'.',aForm: false});