I dig further and found out that by manually changing the javascript inside the returned servlet response and manually pasting it into textbox and highlighting contains html renders correctly. But when I tried to automate the process using replace string. It stopped working.
Manually edited script is here
http://www.heypasteit.com/clip/2RG0
Original script
http://www.heypasteit.com/clip/2RB1
Did this to automate the process
Code: Select all
fields.test1.value = getResponseText(input1);
fields.test1.value= fields.test1.value.replace('Labels = document.all("domLabels").XMLDocument;', 'Labels = document.getElementById("domLabels");');
fields.test1.value = fields.test1.value.replace('if (Labels.parseError.errorCode != 0)',"");
fields.test1.value = fields.test1.value.replace("alert('Please contact your System Administrator","");
fields.test1.value = fields.test1.value.replace("' + Labels.parseError.reason);","");
fields.test1.value = fields.test1.value.replace("labelsError = true;","");
fields.test1.value = fields.test1.value.replace('Label = Labels.getElementsByTagName(label).item(0);', 'Label = document.getElementsByTagName(label).item(0);');
text field has test1 variable.
I get following error when I try to automate the process.
In javascript I would get error as "ufsmain:459 Uncaught ReferenceError: writeLabel is not defined"
In manual text entry I don't get such error. writeLabel is defined function in script tag in the html response from servlet.