I am working in the AgentTicketPhone.dtl to show TicketFreeText1 only when a few Services are selected.
But I have the problem that TicketFreeText1 isn't hidden from the start, so the rest can't work too.
Code: Select all
<script type="text/javascript">//<![CDATA[
$('#TypeID').bind('change', function (Event) {
Core.AJAX.FormUpdate($('#NewPhoneTicket'), 'AJAXUpdate', 'TypeID', 'ServiceID', ['NewUserID', 'NewResponsibleID', 'NextStateID', 'PriorityID', 'ServiceID', 'SLAID', 'SignKeyID', 'CryptKeyID', 'TicketFreeText1', 'TicketFreeText2', 'TicketFreeText3', 'TicketFreeText4', 'TicketFreeText5', 'TicketFreeText6', 'TicketFreeText7', 'TicketFreeText8', 'TicketFreeText9', 'TicketFreeText10', 'TicketFreeText11', 'TicketFreeText12', 'TicketFreeText13', 'TicketFreeText14', 'TicketFreeText15', 'TicketFreeText16', 'To', 'Cc', 'Bcc']);
#Show TicketFreeText1 START
#only while ServiceID = 3,4,7,23,24
Core.Customer.InitFocus();
function nonetext() {
document.getElementById('TicketFreeText1').style.display = 'none';
document.getElementById('LabelTicketFreeText1').style.display = 'none';
}
switch ($('#ServiceID').val() ) {
case "3":
nonetext(); // This clears all the ticketfreetext listed before showing what you want
document.getElementById('TicketFreeText1').style.display = 'block';
document.getElementById('LabelTicketFreeText1').style.display = 'block';
break;
case "4":
nonetext(); // This clears all the ticketfreetext listed before showing what you want
document.getElementById('TicketFreeText1').style.display = 'block';
document.getElementById('LabelTicketFreeText1').style.display = 'block';
break;
case "7":
nonetext(); // This clears all the ticketfreetext listed before showing what you want
document.getElementById('TicketFreeText1').style.display = 'block';
document.getElementById('LabelTicketFreeText1').style.display = 'block';
break;
case "23":
nonetext(); // This clears all the ticketfreetext listed before showing what you want
document.getElementById('TicketFreeText1').style.display = 'block';
document.getElementById('LabelTicketFreeText1').style.display = 'block';
break;
case "24":
nonetext(); // This clears all the ticketfreetext listed before showing what you want
document.getElementById('TicketFreeText1').style.display = 'block';
document.getElementById('LabelTicketFreeText1').style.display = 'block';
break;
default:
document.getElementById('TicketFreeText1').style.display = 'none';
document.getElementById('LabelTicketFreeText1').style.display = 'none';
}
#Show TicketFreeText1 END
});
//]]></script>