Forum

How to make dropdow...
 
Notifications
Retirer tout

How to make dropdown visible true/ false and required true/ false?

2 Posts
2 Utilisateurs
0 Reactions
4,442 Vu
Sagar
(@sagar-toshniwal)
Posts: 72
Estimable Member
Début du sujet
 
[#3584]

I am making a small change in the Ticket form. Based on a particular status, I want to show Priority dropdown and make it mandatory. However, in all statuses before this, the Priority dropdown is hidden. The statuses are driven by workflow.

I could make the dropdown readOnly true or false. However, I am not getting any solution to make it visible true or false, and required true or false.

Please help.


I am an Eagle. On a mission to help those who want to help themselves...

 
Posté : 19/08/2016 8:49 am
(@babynus)
Posts: 14952
Membre Admin
 

Just use $_fieldsAttributes that you change in constructor

function __construct($id = NULL, $withoutDependentObjects=false) {
parent::__construct($id,$withoutDependentObjects);
    if ($this->idStatus=1 or $this->idStatus=2) { // and so on
      self::$_fieldsAttributes['idPriority']='hidden';
    } else {
      self::$_fieldsAttributes['idPriority']='required';
    }
}

 
Posté : 19/08/2016 11:22 am
Share:
Retour en haut