[SOLVED] Element Dropdown Databasejoin | Display dropdown options according to system date

marcq

Member
Hi,

I would like to display the options of a fabrik dropdown database join element according to the system date.

  1. I have created a form where the user (admin can define the options of a dropdown element). This form contain among others a element where he can define the date at which he would like the option being displayed in the dropdown
  2. I have created a form with a dropdown database element where the user should be able to find only the options which are equal to the actual system date (field displaydate).
  3. The dropdown table "fab_dropdown_date_edit" as a field called "displaydate" where the date is filled in ex.: "2016-02-08 09:11:00"

I would appreciate your help.

If you want to have a look, please go to "My sites" -> Site name FABRIK, you will also find the related forms #.

Thanks in advance, cheers,

Marc
 
see Data-where on database join element wiki
This can be:
{thistable}.displaydate = now()

Hi cullet, thanks a lot for your reply.

I added the following code in the where clause:

Code:
{thistable}.displaydate = now() ORDER BY {thistable}.id ASC;

but no option is "available" in the dropdown list.

I have two options with "displaydate" equal to "2016-05-01 09:11:00" (todays date) in the database which should be displayed and 2 other with "2016-02-08 09:11:00" which should be hidden.

I guess it is because of date format, do you have a clue how I could solve this ?
 
Last edited:
Yes it's because of time part, that change all the time ;)

So convert to date only:

DATE({thistable}.displaydate)=CURDATE()
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top