Create field is active only when checkbox ticked

Hello everyone,

I searched in the sugarcrm and suitecrm forums but could not make out how to do this.

I have checkbox field in my list(added using Studio), and two dropdowns after that check box field. The dropdowns should be displayed only when the checkbox is ticked and these values need to be properly entered into the database.

Any help, or maybe, any specific direction that I should go.

Thanks

You need to create a custom js file in order to achieve this
In custom/modules/your_module/metadata/editviewdefs.php

add this code

'includes' =>
      array (
        0 =>
        array (
          'file' => 'custom/include/custom.js',
        ),
      ),

in that file you can do what ever you want with javascript calling the ids of the fields in edit view, right click -> inspect element to see them

best regards

1 Like