I am trying to add attributes to a model, on the fly, like this:
var fieldName = e.currentTarget.name;
var model = this.collection.images.get("2");
model.set({fieldName: e.currentTarget.value});
So, as a user types in a given textbox, this code will be called. The field name is a data attribute for a textbox that corresponds to the model attribute name. The problem is that when this code runs, instead of inserting the given data into the correct attribute, it creates a new one called "fieldName". For example, if e.currentTarget.Name = "test", I would expect that the model attribute called "test" would be set to a given value, not the literal "fieldName". Is there anyway to use the passed value and not the literal?