This topic is locked

Displaying only non-null fields?

3/20/2009 5:54:41 AM
PHPRunner General questions
M
mlapl1 author

Hello
here is a novice question. I am new to phprunner and am REALLY impressed with it.
How would you display a label and the content of the field which accompanies it ONLY if the field is non-null (or non-default). Here is an example.
I have a calendar which displays events. Associated with SOME events is a Venue. I want to display the word "Venue:" followed by "name_of_venue" only if "name_of_venue" is not NULL or some other default.
I am sure there is a simple solution in phprunner.
Thanks for your help

Andrew

J
Jane 3/20/2009

Andrew,
what PHPRunner version do you use? Where do you want to hide field: on the add/edit/list/view pages?

Please give me more detailed description of what you want to achieve.

M
mlapl1 author 3/20/2009

Andrew,

what PHPRunner version do you use? Where do you want to hide field: on the add/edit/list/view pages?

Please give me more detailed description of what you want to achieve.


Thanks for your prompt reply Jane.
I am using phprunner 5.0 (build 766). I want to hide (i.e. not display) a field in the view page. Basically, I am creating a little calendar which can specify

Start Date and End date (in case the event is a multi-day event).
If nothing is specified for the End Date, I would like to NOT display the entire row labelled End Date and not display the default date which is 0000-00-00
Hope that helps and thank you for your assistance.

Andrew

J
Jane 3/23/2009

Hi,
use View page: Before display event on the Events tab for this purpose.

Here is a sample code:

if (!$values["FieldName"])

$xt->assign("PFieldName_fieldblock",False);

M
mlapl1 author 3/29/2009

Hi,

use View page: Before display event on the Events tab for this purpose.

Here is a sample code:


Thanks Jane - works fine except that I had to change PFieldName_fieldblock to FieldName_fieldblock i.e. remove the P at the beginning.
I appreciate your help.

Andrew