Thanks to both. I've used the same code of FRW, but I tried to compact the field when not visible.
Here the results (I'm not a coder, so it's just a try that work):
function dadabik_test(field)
{
if (field.value === "A"){
$('label[for="B"]').css('visibility', 'visible');
$("#B").css('visibility','visible');
$('label[for="B"]').css('display', 'block');
$("#B").css('display', 'block');
$('label[for="B"]').css('max-height', '250px');
$("#B").css('max-height', '250px');
}
else
{
$('label[for="B"]').css('visibility', 'hidden');
$("#B").css('visibility','hidden');
$('label[for="B"]').css('display', 'block');
$("#B").css('display', 'block');
$('label[for="B"]').css('max-height', '0px');
$("#B").css('max-height', '0px');
}
}
I would like to create another JS function that, on page load, automatically hidden the field B, so that it will be show only if field A has the value "A"... Something like:
function dadabik_defaulthidden(field)
{
$('label[for="B"]').css('visibility', 'hidden');
$("#B").css('visibility','hidden');
$('label[for="B"]').css('display', 'block');
$("#B").css('display', 'block');
$('label[for="B"]').css('max-height', '0px');
$("#B").css('max-height', '0px');
}
Unfortunately it's seems that the unload and onbeforeonload trigger doesn't work... Any suggest?
My system info are:
You are using DaDaBIK version 9.0-Monterosso enterprise, installed on 16-08-2018 (installation code: 0), the latest version of DaDaBIK is 9.0-Monterosso released on 05-07-2018
You are runnning the last release of DaDaBIK
PHP Version: 7.2.7
mysql version: 5.7.21
Web server: Apache/2.2.34 (Unix) mod_wsgi/3.5 Python/2.7.13 PHP/7.2.7 mod_ssl/2.2.34 OpenSSL/1.0.2o DAV/2 mod_fastcgi/mod_fastcgi-SNAP-0910052141 mod_perl/2.0.9 Perl/v5.24.0
Client: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/11.1.2 Safari/605.1.15
Ale