I tested successfully this tutorial by crythias: viewtopic.php?t=24116.
The tutorial is to hide dynamic fields for specific Queue. And it work very well. But.... it's not exactly what i'm looking for.
I don't know anything about javascript. And i need some help.
That tutorial only works on Queue field change (switch). And I need hide or show dynamic fields at the page load. I mean.... when CustomerTicketMessage url is loaded, the javascript get the Queue value and hide the dynamic fields cited on javascript.
I tried if statement but unsuccessfully.
This i my current Queue script on CustomerTicketMessage.tt
Code: Select all
<script type="text/javascript">//<![CDATA[
function nonetext() {
$("[id^=DynamicField]").parent().addClass( 'Hidden' );
$("[id^=LabelDynamicField]").parent().addClass('Hidden');
}
$('#Dest').bind('change', function (Event) {
Core.AJAX.FormUpdate($('#NewCustomerTicket'), 'AJAXUpdate', 'Dest', ['TypeID', 'PriorityID', 'ServiceID', 'SLAID', [% Data.DynamicFieldNamesStrg %]]);
switch ( $('#Dest').val() ) {
case "5\|\|NOC": // need to slash escape the pipes. Also, need to be in numerical order
nonetext();
$('#DynamicField_latitude').parent().removeClass( 'Hidden' );
$('#LabelDynamicField_latitude').parent().removeClass( 'Hidden' );
$('#DynamicField_longitude').parent().removeClass( 'Hidden' );
$('#LabelDynamicField_longitude').parent().removeClass( 'Hidden' );
break;
default:
nonetext();
}
});
//]]></script>
[% END %]
Thanks