How can I remove AutoNumeric formatting before submitting form?

后端 未结 11 3047
栀梦
栀梦 2021-02-19 05:26

I\'m using the jQuery plugin AutoNumeric but when I submit a form, I can\'t remove the formatting on the fields before POST.

I tried to use $(\'input\

11条回答
  •  故里飘歌
    2021-02-19 06:22

    $("input.classname").autoNumeric('init',{your_options});
    $('form').submit(function(){
       var form=$(this);
       $('form').find('input.classname').each(function(){
           var self=$(this);
           var v = self.autoNumeric('get');
           // self.autoNumeric('destroy');
           self.val(v);
       });
    });
    

    classname is your input class that will init as autoNumeric Sorry for bad English ^_^

提交回复
热议问题