Hi, I'm trying to use some of the advanced features of Json/Ajax on OTRS 5.Basically I'd like to update the content of a form when changing the value of an element of the same form, like when you select a queue in a new ticket creation form.My code is here:[% WRAPPER JSOnDocumentComplete %]
<script type="text/javascript">//<![CDATA[
$('#SystemSelection').bind('change', function (Event) {
Core.AJAX.FormUpdate($('#AS400Company'), 'AJAXUpdate', 'SystemSelection', [ 'CompanySelection' ] );
}
);
//]]></script>
[% END %]
where SystemSelection is the select control in the template, AJAXUpdate is the subaction i created in the .pm file and CompanySelection is the control that should be updated (I need to launch a db query using the value obtained from SystemSelection as a WHERE condition to get values to populate the CompanySelection control).
Now, every time I try to use that selection, I get this:[ERROR] CommunicationError: Error during AJAX communication. Status: parsererror, Error: SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON dataThe perl module is never recalled with the new subaction. If I remove the Formupdate function and put a stupid window.alert box with the SystemSelection.value, I get the right value.I don't think it's something in the .pm file, since I've also tried to completely remove ANY Json code from the file and just see if the subaction is called, and it isn't.Any hint?--Lynx International SrlStefano FinettiLynx International Srl is a part of AXED GroupVia Pier Luigi Nervi e/3 - Torre 6 - 04100 Latina