When i submit a form i send a serialized object to the server. But before sending it i need to uppercase all its input elements.
this is a piece of my code:
submitForm: function(e) {
e.preventDefault();
var data = Backbone.Syphon.serialize(this);
console.log(data);// here i need to uppercase all data elements
this.trigger("form:submit", data);
},
I need to do this before sending it to thserver and not in the backend. Any solution to suggest?
If
data
is a array of object you need to iterate each object and use the methodtoUpperCase()
, example: