2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-01-31 06:39:11 +00:00

fhemweb.js: set the select value for readings with spaces (FOrum #124505)

git-svn-id: https://svn.fhem.de/fhem/trunk@25289 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
rudolfkoenig 2021-12-03 21:18:05 +00:00
parent d403967941
commit 7b64964102

View File

@ -1583,7 +1583,12 @@ FW_createSelect(elName, devName, vArr, currVal, set, params, cmd)
$(newEl).attr('name', elName);
if(cmd)
$(newEl).change(function(arg) { cmd($(newEl).val()) });
newEl.setValueFn = function(arg) { if(vHash[arg]) $(newEl).val(arg); };
newEl.setValueFn = function(arg) {
if(!vHash[arg])
arg = arg.replaceAll(" ","."); // Forum #124505
if(vHash[arg])
$(newEl).val(arg);
};
return newEl;
}