1
0
mirror of https://github.com/s00500/ESPUI.git synced 2025-07-04 06:10:18 +00:00

Allow Max control to add maxlength to text input. Update docs.

This commit is contained in:
Ian Gray
2022-01-14 20:24:23 +00:00
parent 254912aee5
commit 6a513e9f65
4 changed files with 21 additions and 4 deletions

8
data/js/controls.js vendored
View File

@ -441,7 +441,13 @@ function start() {
if (data.parentControl) {
var parent = $("#id" + data.parentControl + " input");
if (parent.size()) {
parent.attr("max", data.value);
if(!parent.attr("type")) {
//type is not set so therefore it is a text input
parent.attr("maxlength", data.value);
} else {
//type might be range (slider) or number
parent.attr("max", data.value);
}
}
}
break;