Hide Show Dynamic Fields

Moderator: crythias

Locked
ciotola
Znuny newbie
Posts: 35
Joined: 27 Apr 2012, 13:56
Znuny Version: 3.2.9 /3.3 / 4.0.5
Real Name: Giampiero
Company: Atos
Location: Roma - IT

Hide Show Dynamic Fields

Post by ciotola »

HI to all,
we have implemented Hide/show DynamicFields as described in the thread
viewtopic.php?f=60&t=8032&start=50

Well ... but is also possible do the same instead with the Queue or TicketType with another DynamicFields?

We need this
- if the Customer select a value "aaaa" in the Field1 the FieldsX, FieldsY became visible
- if the Customer select a value "bbb" in the Field1 the FieldsA, FieldsB became visible

The code below seems not work.
Is it possibile do a switch on a dynamic field value?

Code: Select all

switch ($('#DynamicField_Field1).val() ) {
    case  "aaaa": // need to slash escape the pipes              
      nonetext();
      document.getElementById('DynamicField_X').style.display = 'block';
      document.getElementById('LabelDynamicField_X').style.display = 'block';
       document.getElementById('DynamicField_Y').style.display = 'block';
      document.getElementById('LabelDynamicField_Y').style.display = 'block';   
   case  "bbbb": // need to slash escape the pipes              
      nonetext();
      document.getElementById('DynamicField_A').style.display = 'block';
      document.getElementById('LabelDynamicField_A').style.display = 'block';
      document.getElementById('DynamicField_B').style.display = 'block';
      document.getElementById('LabelDynamicField_B').style.display = 'block';   
break;
OTRS in several version starting from 3.0

Production Environment
OTRS 4.0.5 - Postgres9.3
ITSM, KIX4OTRS, FAQ,SURVEY
OS RedHat 6.4

Auth: Ldap - CAS - DB
Locked