Welcome to the nuBuilder forums!
Please register and login to view forums and other content only available to registered users.
Please register and login to view forums and other content only available to registered users.
Conditional Formatting
-
- Posts: 4
- Joined: Tue May 15, 2012 10:15 pm
Conditional Formatting
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
Last edited by Mx32 on Thu Jun 07, 2012 2:19 am, edited 1 time in total.
-
- Site Admin
- Posts: 2781
- Joined: Mon Jun 15, 2009 2:23 am
- nuBuilder Version: 4.5
- Been thanked: 1 time
Re: Conditional Formatting
MX32,
Put something like this in the JavaScript section of the form your field is on..
and
in the onChange of the object.
Steven
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';
}
}
Code: Select all
fldColor(this)
Steven
-
- Posts: 4
- Joined: Tue May 15, 2012 10:15 pm
Re: Conditional Formatting
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!
It worked perfectly (just correcting the typo in ".value") no further customization needed for my application, thanks for taking the time to help!