I'm currently working on some adjustments to my Customer Interface. OTRS version is 3.3.
With the help of the topics viewtopic.php?f=60&t=8032 and viewtopic.php?f=60&t=24116 I could solve most of my problems, so first of all thanks to everybody who posted there!
The last point on my to do list that is missing now, has to do with dynamic fields of the type "date".
The following code is working:
Code: Select all
$('#DynamicField_Dyn1').bind('change', function (Event) {
switch ($('#DynamicField_Dyn1').val() ) {
case "yes":
$('#DynamicField_Dyn1bText').parent().removeClass( 'Hidden' );
$('#LabelDynamicField_Dyn1bText').parent().removeClass( 'Hidden' );
$('#DynamicField_Dyn1bText').addClass( 'Validate_Required' );
break;
case "no":
$('#DynamicField_Dyn1bText').parent().addClass( 'Hidden' );
$('#LabelDynamicField_Dyn1bText').parent().addClass( 'Hidden' );
$('#DynamicField_Dyn1bText').removeClass( 'Validate_Required' );
$('#DynamicField_Dyn1bText').val('');
break;
default:
break;
}
Core.AJAX.FormUpdate($('#NewCustomerTicket'), 'AJAXUpdate', 'Dest', ['TypeID', 'PriorityID', 'ServiceID', 'SLAID', $Data{"DynamicFieldNamesStrg"}]);
});
The following code is not working:
Code: Select all
$('#DynamicField_Dyn2').bind('change', function (Event) {
switch ($('#DynamicField_Dyn2').val() ) {
case "yes":
$("[id^=DynamicField_Dyn2bDate]").parent().removeClass( 'Hidden' );
$("[id^=LabelDynamicFieldDyn2bDate]").parent().removeClass( 'Hidden' );
$("[id^=DynamicField_Dyn2bDate]").addClass( 'Validate_Required' );
break;
case "no":
$("[id^=DynamicField]_Dyn2bDate").parent().addClass( 'Hidden' );
$("[id^=LabelDynamicField_Dyn2bDate]").parent().addClass( 'Hidden' );
$("[id^=DynamicField_Dyn2bDate").removeClass( 'Validate_Required' );
$("[id^=DynamicField_Dyn2bDate").val('');
break;
default:
break;
}
Core.AJAX.FormUpdate($('#NewCustomerTicket'), 'AJAXUpdate', 'Dest', ['TypeID', 'PriorityID', 'ServiceID', 'SLAID', $Data{"DynamicFieldNamesStrg"}]);
});
I think it has to do with the type as this was also the reason why the "id^=" in the beginning of the lines was needed.
Could anybody give me some advice on how to set the date-field back to Null? (or uncheck the checkbox in front of the date)
I already tried with .val('false'), .val('uncheck'), .val('reset').
Thanks for reading.
