Is it possible in a global method to get the element name that is currently in focus?
I have several fields that when clicked on, I would like them to clear. But in order to do it as a global method, I would need the element name that is in focus. That way I can tell the field to clear it’s information. The other way to do it is to create a different script for each field. May too many scripts to do something soo simple.
Jim is on the right track. The following code gets us closer I think:
// this script should be attached to an onFocusGained event (make sure you've set the "name" property)
var formName = application.getMethodTriggerFormName();
var elementName = application.getMethodTriggerElementName();
// to make any changes to the field, we need the dataprovider name associated with the element name
var fieldName = forms[formName].elements[elementName].getDataProviderID();
// clearing the field
forms[formName].controller.setDataProviderValue(fieldName, null);
I’m trying to become the Clown Prince of Abstraction