How can I remove AutoNumeric formatting before submitting form?

后端 未结 11 3018
栀梦
栀梦 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:16

    Inside data callback you must call getString method like below:

            $("#form").autosave({
            callbacks: {
                data: function (options, $inputs, formData) {
    
                    return $("#form").autoNumeric("getString");
                },
                trigger: {
                    method: "interval",
                    options: {
                        interval: 300000
                    }
                },
                save: {
                    method: "ajax",
                    options: {
                        type: "POST",
                        url: '/Action',
                        success: function (data) {
    
                        }
                    }
                }
            }
        });
    

提交回复
热议问题