From f291908c7b80e4ebdaf1265f8dd993a424cb0cb7 Mon Sep 17 00:00:00 2001 From: Ad Schellevis Date: Mon, 21 Nov 2022 20:40:30 +0100 Subject: [PATCH] UI - Javascript (setFormData) - prevent "Uncaught DOMException: Failed to set the 'value' property on 'HTMLInputElement': This input element accepts a filename, which may only be programmatically set to the empty string" when a form contains file inputs --- src/opnsense/www/js/opnsense.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/opnsense/www/js/opnsense.js b/src/opnsense/www/js/opnsense.js index 6fb5bd59d..e0cfa0d89 100644 --- a/src/opnsense/www/js/opnsense.js +++ b/src/opnsense/www/js/opnsense.js @@ -179,7 +179,7 @@ function setFormData(parent,data) { } else if (targetNode.hasClass('json-data')) { // if the input field is JSON data, serialize the data into the field targetNode.data('data', node[keypart]); - } else { + } else if (targetNode.attr('type') !== 'file') { // regular input type targetNode.val(htmlDecode(node[keypart])); }