Hide Element onLoad using PHP, not JS

ricslabb03

Member
Hi there,

I have always used the element JS plugin onload to hide elements. However, it is undesirable due to the momentary flashing of elements. I would therefore like to do it on the server-side before the rendering of the DOM. Here is a similar question: http://fabrikar.com/forums/index.ph...n-depens-on-other-elements.39384/#post-198233

@lke suggested:
PHP:
$elem = $formModel->getElement('table___element');
$elem->access->view = false; //to hide the element on details view
$elem->access->use = false;  //to hide the element on edit view

However, getElement does not work for me in the PHP onload form plugin. Is getElement still used? Or is it not applicable for onLoad? If so, what could I use?

Thnx,
Richard
 
Same question on same problem. This does not work, but I reallye want to "hide" conditionally in PHP
 
You can set
$elem->hidden = '1';
But keep in mind: a hidden element (also hidden via JS) is always still "there" and can be read and modified by the user.

For accessing element data (or properties) at different points use the jdump extension which will give you data and properties and methods.
 
Last edited:
You can set
$elem->hidden = '1';
But keep in mind: a hidden element (also hidden via JS) is always still "there" and can be read and modified by the user.

For accessing element data (or properties) at different points use the jdump extension which will give you data and properties and methods.

$elem = $formModel->getElement('table___element');
$elem->hidden = '1';

still didn't work.. i tried onCanEditGroup and onLoad
the element still visible
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top