i know, that this problem is mentioned in some threads here in the English and the German Forum. I have tried for some days to get a solution that will work for me - but till now i dont have a solution... I have read Threads, change codes, and so on... I think i have to give up.
I'm new in OTRS and before i checked it, that the FreeTextFields will be invalid till OTRS 3.1 (now DynamicFields) i went the wrong way to deal with. I have found a HowTo in the English Forum:
viewtopic.php?f=60&t=8032
On the beginning of the thread the problem will be solved with the old FreeTextFields. But later on the thread someone (thx to Giulio Soleni) changed the code for the new DynamicFields. It is explained OK - but the code dont work for me. Perhaps I have a thinking error in doing this...therefore i write this Thread...

Like mentioned in the title i would like to show individual form-fields in the customer frontend by selecting the qeue.
Version of OTRS: 3.1.2
For testing i established 4 Mainqeues an 1 Subqeue:
Altglas
Kunststoff
Kunststoff::ASA
Metalle
Postmaster
The following Code was copied into the "CustomerTicketMessage.dtl":
Code: Select all
<!--dtl:js_on_document_complete-->
<script type="text/javascript">//<![CDATA[
$('#TypeID').bind('change', function (Event) {
// make sure the ticket is not yet created on queue change
$('input#Expand').val(1);
Core.Form.Validate.DisableValidation($(this).closest('form'));
$(this).closest('form').submit();
});
----->HERE IS THE CODE MENTIONED ABOVE<-----
//]]></script>
<!--dtl:js_on_document_complete-->
Code: Select all
function nonetext() {
document.compose.Subject.value = "";
document.compose.RichText.value = "";
document.getElementById('DynamicField_Metalltyp').style.display = 'none';
document.getElementById('LabelDynamicField_Metalltyp').style.display = 'none';
document.getElementById('DynamicField_Glastyp').style.display = 'none';
document.getElementById('LabelDynamicField_Glastyp').style.display = 'none';
document.getElementById('DynamicField_Kunststofftyp').style.display = 'none';
document.getElementById('LabelDynamicField_Kunststofftyp').style.display = 'none';
}
switch ($('#Dest').val() ) {
case "2\|\|Metalle": // need to slash escape the pipes
nonetext();
document.getElementById('DynamicField_Metalltyp').style.display = 'block';
document.getElementById('LabelDynamicField_Metalltyp').style.display = 'block';
document.getElementById('DynamicField_Metalltyp').className = 'Validate_Required';
break;
case "3\|\|Altglas": // need to slash escape the pipes
nonetext();
document.getElementById('DynamicField_Glastyp').style.display = 'block';
document.getElementById('LabelDynamicField_Glastyp').style.display = 'block';
document.getElementById('DynamicField_Glastyp').className = 'Validate_Required';
break;
case "4\|\|Kunststoff": // need to slash escape the pipes
nonetext();
document.getElementById('DynamicField_Kunststofftyp').style.display = 'block';
document.getElementById('LabelDynamicField_Kunststofftyp').style.display = 'block';
document.getElementById('DynamicField_Kunststofftyp').className = 'Validate_Required';
break;
default:
nonetext();
}
I would be very happy for tips, solutions or hints...
Greetz