Change font color for Textboxes on standard screens

By | August 16, 2011
Let’s say I want to change the way text appears in a textbox when the screen loads as well as when I type in the field.

Here is the function you can write in Custom Content of the screen to achieve the same.

Script

//’Function to change text color in

function ChangeTextColor(FldName,TextColor)

{

FldName = new String(FldName);

FldName = FldName.toLowerCase();

TextColor = new String(TextColor);

if(eval(“document.EntryForm.”+FldName))

{

eval(“document.EntryForm.”+FldName+”.style.color = ‘”+TextColor+”‘”);

}

}

You can call this function as given below.

Script

//Call function to change text color in textbox

//Pass the field name and color value

ChangeTextColor(“comp_name”,”Red”)

If you find this content useful, please drop us an email at crm@greytrix.com.