mirror of
https://github.com/s00500/ESPUI.git
synced 2025-07-06 09:40:20 +00:00
Preselect the right option in the select-input
This commit is contained in:
2
data/js/controls.min.js
vendored
2
data/js/controls.min.js
vendored
@ -157,7 +157,7 @@ data.id+
|
||||
"' onchange='selectchange("+
|
||||
data.id+
|
||||
")' />"+
|
||||
"</div>");break;case UI_OPTION:if(data.parentControl){var element=$("#select"+data.parentControl);element.append("<option id='option"+data.id+"' value='"+data.value+"'>"+data.label+"</option>");}
|
||||
"</div>");break;case UI_OPTION:if(data.parentControl){var element=$("#select"+data.parentControl);element.append("<option id='option"+data.id+"' value='"+data.value+"' "+data.selected+">"+data.label+"</option>");}
|
||||
break;case UPDATE_SELECT:$("#select"+data.id).val(data.value);break;default:console.error("Unknown type or event");break;}};websock.onmessage=handleEvent;}
|
||||
function numberchange(number){var val=$("#num"+number).val();websock.send("nvalue:"+val+":"+number);console.log(val);}
|
||||
function textchange(number){var val=$("#text"+number).val();websock.send("tvalue:"+val+":"+number);console.log("tvalue:"+val+":"+number);console.log(val);}
|
||||
|
Reference in New Issue
Block a user