Fixed bug with field staying red

This commit is contained in:
2023-02-28 15:04:08 +01:00
parent ff7e7461e9
commit 773e2ac17e

View File

@@ -29,6 +29,7 @@ function fillDefaultXML(element) {
.then(response => response.text()) .then(response => response.text())
.then((exampleData) => { .then((exampleData) => {
document.getElementById("xmlArea").value = exampleData; document.getElementById("xmlArea").value = exampleData;
document.getElementById("xmlArea").style.backgroundColor = null;
}) })
} }
} }
@@ -161,6 +162,10 @@ function performFormatRequest(endpoint, checkXML, sourceId, targetId){
restRequest(port, endpoint, xmlData, "").then(function(result) { restRequest(port, endpoint, xmlData, "").then(function(result) {
if (result.status == "OK") { if (result.status == "OK") {
document.getElementById(targetId).value = result.result; document.getElementById(targetId).value = result.result;
document.getElementById(targetId).style.backgroundColor = null;
}
else {
document.getElementById(targetId).style.backgroundColor = color_red;
} }
}); });