Buy Now
Sign in

Sel year empty

webcrea , March 20 at 15:05
webcrea
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
Christophe
http://www.webcrea.fr
admin
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
If your main question got answered then please mark the answer using the button!​
​Please let us know if you have any problems with the new forums text editor, we appreciate your feedback!
webcrea
Hi Max,
this is not very easy. Until now we don't need to do that.
Chris
Christophe
http://www.webcrea.fr
admin
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
If your main question got answered then please mark the answer using the button!​
​Please let us know if you have any problems with the new forums text editor, we appreciate your feedback!
webcrea
thanks Max
Christophe
http://www.webcrea.fr