Forums

Sel year empty

webcrea 20 Mar, 2018
Hi,

I have a dropdown with year
=Year
2011=2011
2012=2012
2013=2013
2014=2014
2015=2015
2016=2016
2017=2017
2018=2018

when year selected the filter should not appear in query

versions.programs_id:{data:sel_programs}/-
year(enrollments.exam_passed):{data:sel_year}/-
enrollments.exam_score/>=:{data:sco_min}/-
enrollments.exam_score/<:{data:sco_max}/-

and it apears and make filter on empty date (0000). so i would want all year

regards
Chris
Max_admin 25 Mar, 2018
Hi Chris,

The "-" will not be enough here, you will need a PHP action to check the value and unset it if its empty

Best regards
Max
ChronoForms developer...
Did you try ChronoMyAdmin for managing your Joomla database tables ?
webcrea 26 Mar, 2018
Hi Max,

this is not very easy. Until now we don't need to do that.

Chris
Max_admin 30 Mar, 2018
1 Likes
Hi Chris,

Not very difficult too, just the code below:
if(empty($this->data("sel_year"))){
$this->set("sel_year", null);
}else{
$this->set("sel_year", $this->data("sel_year"));
}
Then use {var:sel_year} in your code!

Best regards
Max
ChronoForms developer...
Did you try ChronoMyAdmin for managing your Joomla database tables ?
This topic is locked and no more replies can be posted.