You need to sign in to do that
Don't have an account?
Sivakumari2i
How to change text color based on some condition
Hi,
I have a text in visualforce page. If the value is less than 100 then i have to change the font color to red and if it is greater than 100 then i have to change the font color to green.
I dont know how to achieve this.
Please explain me with some examples.
Thanks,
S.Sivakumar.
All Answers
Hi
This is possible by javascript,You can call a javascript function by clicking a button and link.In that jave script function you write condition for color change.
for your reference you can check my previous post .
http://boards.developerforce.com/t5/Visualforce-Development/How-to-change-color-of-a-link-from-one-color-to-another-color/m-p/502543#M55927
DId this post answers your questions If so please mark it as solved.
please hit the kudos if this post helps you for other's benifit.
Thanks
hi, i am not able to map your approach.
Here is my page code :
<table>
<tr><td>Attainment</td>
<td>{!selectedAttainment}%</td>
</tr>
</table>
Here value of {!selectedAttainment} is returned from controller. If the vaue is >= 100 then i have to display it in green and if it is <100 then i have to display it in red.
How to achieve this?
Thanks,
S.Sivakumar
i am getting following error
Visualforce Error
The value 'null' is not valid for operator '>'
thanks,
S.Sivakumar
It worked.Thank you very much.
Can you explain me that?
Thanks,
S.Sivakumar.
I tried this already without checking for not null.
Why you are checking for not null condition?
Is that necessary?
Thanks,
S.Sivakumar
k thanks for your reply.