Page 1 of 1

Conditional Formatting

Posted: Thu May 24, 2012 7:10 am
by Mx32
Is it possible to change the formatting of objects programmatically? I want to turn a Text object to red font if a condition is met. Any idea will be appreciated. Thanks

Re: Conditional Formatting

Posted: Wed Jun 06, 2012 4:12 am
by admin
MX32,

Put something like this in the JavaScript section of the form your field is on..

Code: Select all

function fldColor(pThis){
   if(pThis.vale == 'bad'){
      pThis.style.color = 'red';
   }else{
      pThis.style.color = 'black';
   }
}
and

Code: Select all

fldColor(this)
in the onChange of the object.

Steven

Re: Conditional Formatting

Posted: Wed Jun 06, 2012 10:49 pm
by Mx32
Thank you Steve,
It worked perfectly (just correcting the typo in ".value") no further customization needed for my application, thanks for taking the time to help! :)

Re: Conditional Formatting

Posted: Thu Jun 07, 2012 3:01 am
by admin
no worries..