jQuery-File-Upload clean FormData with autoNumeric
Hello Everyone,
I need a little help. I`m use the jQuery-File-Upload plugin to upload files to my server with additional Formdata
Now i want format the input values with autoNumeric but it have to send clean (without any delimiters) to the server.
How can i clean the from values bevor sending?
This is how i try it:
- function initAutoFileUpload() {
- 'use strict'
- $('#fu-my-auto-upload').fileupload({
-
- url: baseadd + '/ImportReichweite/Excel',
- autoUpload: true,
- dataType: 'json',
- fromData: $('my-form').autoNumeric('getString'),
- contentType: false,
- processData: false,
-
- add: function (e, data) {
-
- self.DeleteKurve()
- $.each(data.files, function (index, file) {
- $('.file_name').html(file.name);
- });
-
- var progress = parseInt(data.loaded / data.total * 100, 10);
- $(".progress").addClass("progress-striped active");
- $(".progress .progress-bar").css("width", "0%");
-
-
- var jqXHR = data.submit()
-
- //clean the form data here
- var ha = $('#My-Form').autoNumeric('getString');
- data.fromData = ha;
- .success(function (data, textStatus, jqXHR) {
- if (data.isUploaded) {
- }
- else {
- }
- })
- .error(function (data, textStatus, errorThrown) {
-
- if (typeof (data) != 'undefined' || typeof (textStatus) != 'undefined' || typeof (errorThrown) != 'undefined') {
- alert(textStatus + errorThrown + data);
-
- }
- })
-
- ;
- },
- progress: function (e, data) {
- var progress = parseInt(data.loaded / data.total * 100, 10);
- $('.progress .progress-bar').css('width', progress + '%');
- //$("#fu-my-auto-upload").click(function () {
- // $("#My-Form").valid();
-
- //});
- },
- //processdone: function (e, data) {
- // data.context.find('.start').button('enable');
- //},
- done: function (e, data) {
- $(".progress").removeClass("progress-striped active"); // we're done
-
- //debugger;
- self.GR.removeAll();
- var test;
- $.getJSON(PointsUri,
- function (data) {
- dataType: 'json'
-
-
-
- for (var i = 0; i < data.length; i++){
-
- self.GR.push(data[i].GR)
- self.Points.push(data[i].reichw)
-
- }
-
- }
- )},
- fail: function (event, data) {
- if (data.files[0].error) {
- alert(data.files[0].error);
- }
- }
- });
- }