Originally published on 2018-05-10

If we need a placeholder text to disappear on the static background.

Mutiple Fields

Actions of the field

OnFocus:fillWhite();

OnBlur: fillTransparent();

textFields();

function textFields()
{
    for (var fieldNumber = 0; fieldNumber < numFields; fieldNumber++) 
    {    
        var aField = getField(getNthFieldName(fieldNumber));
        if (aField.type === "text" || aField.type == "combobox") 
        {
            aField.setAction("OnFocus", "fillWhite();");
            aField.setAction("OnBlur", "fillTransparent();");
        }
    }
}


function fillWhite()
{
    var me = getField(event.target.name);
    me.fillColor = color.white;
}


function fillTransparent()
{
    var me = getField(event.target.name);
    if (me.valueAsString.trim() == "" && !color.equal(me.fillColor, color.transparent)) 
    {
        me.fillColor = color.transparent;
    }
}