1
0
mirror of https://github.com/s00500/ESPUI.git synced 2025-07-04 11:20:19 +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

View File

@ -267,6 +267,17 @@ The textinput works very similar like the number input but with a string. You
can enter a String into it and when you are done with your change it is sent to
the ESP.
If you attach a Max control to the text input then a max length will be applied
to the control.
```
text = ESPUI.text("Label", callback, ControlColor::Dark, "Initial value");
ESPUI.addControl(ControlType::Max, "", "32", ControlColor::None, text);
```
However even with a set maximum length, user input should still be validated
because it is easy to bypass client-side checks.
#### Graph
![graph](https://github.com/s00500/ESPUI/blob/master/docs/ui_graph.png)