3

I'm trying to apply encodeURIComponent() to the data before submitting it to the server. I've tried :

submitdata: function (value, settings) {
    return {
        value: encodeURIComponent(value)
    }
},

but this doesn't work. It always picks the old value. How do I fix that?

Alessandro Vendruscolo
  • 14,493
  • 4
  • 32
  • 41
cowboyzed
  • 31
  • 4

1 Answers1

1

Works for me. I did

var submitdata = function (value, settings) {
    return {
        value: encodeURIComponent(value);
    }
}

var x = submitdata("http://abc.com/?{sss}&as=ee", 1);

alert(x.value);

returns

"http%3A%2F%2Fabc.com%2F%3F%7Bsss%7D%26as%3Dee"