diff --git a/add.php b/add.php index 4dc2add2c..4a773117e 100755 --- a/add.php +++ b/add.php @@ -86,7 +86,7 @@ $(document).ready(function(){ id_plugin: "'.$id_plugin.'", }).then(function(response) { // Selezione automatica nuovo valore per il select - var select = input($("#'.get('select').'")); + var select = input("#'.get('select').'"); if (select) { select.getElement().selectSetNew(response.id, response.text, response.data); //select.change(); diff --git a/assets/src/js/functions/input.js b/assets/src/js/functions/input.js index 201b886bd..400fd3a3a 100644 --- a/assets/src/js/functions/input.js +++ b/assets/src/js/functions/input.js @@ -38,6 +38,11 @@ function input(name) { element = $(name); } + // Selezione tramite ID + else if (name.substr(0,1) == "#") { + element = $(name).last(); + } + // Selezione per nome else { element = $("[name='" + name + "']").last();