Data field name from data changed event

Hi guys!

I want to force some of the fields to uppercase. I can set the format to UUUU, but I don’t want to do that because sometimes user gets stuck when the field is validated (the text becomes red).

So I have the option to set it to uppercase when the data change event occurs. The thing is that I need this for several fields and I need to know the name of the field in the event method, so I can use only one method implementation. I would like to get the name of the database field from the event object, but I don’t know how and also it might not be available.

Does anyone know how to obtain the name of the database field on a data change event method in an elegant way?

Thanks a lot!
Bogdan.

You need to give your field a name, then in the onDataChange event handler, you can do:

var formName = event.getFormName();
var elementName = event.getElementName();
if (elementName) {
    var frm = solutionModel.getForm(formName);
    var elem = frm.getField(elementName);
    var dataProvider = elem.dataProviderID;
    // do whatever you want with that dataProvider value...
}

Hi! Thanks a lot! Really appreciate!