This topic is locked

How to hide empty fields on View page

11/17/2010 12:38:37 PM
ASPRunnerPro Tips and tricks
admin

Let's say you have a load of fields on the View page and want to hide those that are empty.
For this purpose in 'View page: before display' event use the following code for each field you need to hide. This example uses field named EPAHighway:



if values("EPAHighway")="" or values("EPAHighway")=0 then

xt.assign "EPAHighway_fieldblock",false

end if
A
afa1999 1/8/2011



Let's say you have a load of fields on the View page and want to hide those that are empty.
For this purpose in 'View page: before display' event use the following code for each field you need to hide. This example uses field named EPAHighway:



if values("EPAHighway")="" or values("EPAHighway")=0 then

xt.assign "EPAHighway_fieldblock",false

end if




After using the code, I got this error:

Parse error: syntax error, unexpected T_STRING, expecting '(' in D:\xampp\htdocs\xxx\include\xxx_events.php on line 311

the line is
if values("RequisitionDate1")="" or values("RequisitionDate1")=0 then

xt.assign "RequisitionDate1_fieldblock",false

end if

Is there any way to fix it?

Thanks in advance.
Sory, I found it like this way
if ($values["RequisitionDate1"]=="" || $values["RequisitionDate1"]==0)

$xt->assign("RequisitionDate1_fieldblock",false);

All the best.

T
tttt141 1/10/2011

thanks

N
nti 5/18/2011

Does this tip work with phpr 5.3 build 7474 also?

admin 5/18/2011

Yes, it does. Just make sure you use example from PHPRunner manual.

C
CodeIsPoetry 2/29/2012



Let's say you have a load of fields on the View page and want to hide those that are empty.
For this purpose in 'View page: before display' event use the following code for each field you need to hide. This example uses field named EPAHighway:



if values("EPAHighway")="" or values("EPAHighway")=0 then

xt.assign "EPAHighway_fieldblock",false

end if



Hi there!

This code only work in the View page. How can I make something like this but in edit mode.
Thank you.
Best Regards