Hello !
I have created several custom modules, in which some fields are dynamic (depend on the value of a dropdown). I managed to make those fields appear/disappear as I want in edit View and quickcreate View, with a js function Added on the onchange parameter of the dropdown field.
I then adapted my functions to make them appear/disapear in detail view. I changed my javascript file so that the function runs when the file is loaded, and I Added the file like that :
$viewdefs [âcrm20_Testâ][âDetailViewâ][âtemplateMetaâ][âincludesâ] = array ( array (âfileâ => âcustom/include/showhide_test_detail.jsâ));
For my first module, it works perfectly, and the fields are displayed as I wish.
The issue is with the second one. I do exactly the same thing, but it doesnât work. In my js file, I used a getElementById to get the value of my dropdown field (on which the others depend), but it always return ânullâ. I checked my html page, and the id I am using is the right one.
I feel like in my two modules, the included js files donât run at the same step of the page loading, is that possible ? Do you know what defines that and how to change it ?
I really donât understant where is the problem, I created my two custom modules exactly the same, and proceeded the same way with everything.
Please I really need help with that, so if anyone has a solution for me, or an intell on how to locate the issue
Or even another way that I could hide fields dynamicly on detail-viewâŚ