[SOLVED] Change Element color (date) if value is less than two years ago

maxinic

Member
Hy everyoneI
I have a form with a date type element. I would like to turn red format if the date entered is before two years ago. is it possible to do it in the list? sorry i resumed fabrik after 9 years and i'm a bit rusty
 
Maybe the following post will u an idea:
https://fabrikar.com/forums/index.php?threads/solved-conditional-formatting.49361/#post-257790

I would compare the date based on current and return the color accordingly.

BTW..You post on a forum refering to old version of Joomla (2.5).



i followed the post and now i have a calc field (set this element to "Use as row class" in List view settings) which returns me a css class name. Now I have edited my custom_css.php but nothing happens. this is my custom_css.php :

header('Content-type: text/css');
$c = $_REQUEST['c'];
echo <<<EOT
/* BEGIN - Your CSS styling starts here */


#listform_$c tr.colred td.anagtafica___diffdata {color:red;};
#listform_$c tr.colwhite td.anagtafica___diffdata {color:white;};

#listform_$c {
margin-top: 25px !important;

}
 
The calc element should return a string based on the date comparison.
Based on that string value you prepare the custom_css.php
Have you followed this procedure?
 
The calc element should return a string based on the date comparison.
Based on that string value you prepare the custom_css.php
Have you followed this procedure?

First of all, Thanks Dimoss
Yes my calc element can return only 2 string: colred or colwhite so i have edited my custom_css.php

so:
#listform_$c tr.colred td.anagtafica___diffdata {color:red;};
#listform_$c tr.colwhite td.anagtafica___diffdata {color:white;};
but nothing happen
(if i print my calc element it's return colred or colwhite)
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top