Forums

Using Read Data and showing text conditionally based on empty data field

spytech 06 Jun, 2020
Hi,

I have read data event that checks the DB and shows the value on screen. I would like to hide the the data and preceeding text if that field does not have any data in it. My data text and field is as below:

5th Payment due: {date:d-m-Y$(var:read_data28.PDFRead.5th_payment_date)} of £{var:read_data28.PDFRead.5th_payment_amount}

What would be the best way to go about this in Chronoforms?

Thanks.
GreyHead 07 Jun, 2020
Hi spytech,

I'm not completely clear what you need to do here but my guess is that the simplest way would be to use an Event Switcher to add CSS to thr form that disables and hides the elements that you don't need.

Bob
spytech 07 Jun, 2020
Hi Bob, thanks. In the Event Switcher 'Events' section, how do I make one event to be Null and the other event to be contains data?

Cheers
Paul.
GreyHead 08 Jun, 2020
Hi Paul,

Please see the Request Data section in this FAQ and you will see that there is a Short Code that you can use to check for Empty data.

Bob
Max_admin 09 Jun, 2020
In v6 you will need to use HTML view and use PHP around the code to check the value is empty or not!

in v7, there is a "Run Conditions" behavior which you can use to check the value is empty or not directly, this will stop the view from running if the run condition fails!
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
This topic is locked and no more replies can be posted.