mirror of
https://github.com/tzapu/WiFiManager.git
synced 2026-04-27 09:05:56 +03:00
[GH-ISSUE #736] Custom Parameter with validation #614
Labels
No labels
📶 WiFi
🕸️ HTTP
Branch
DEV Help Wanted
Discussion
Documentation
ESP32
Example
Good First Issue
Hotfix
In Progress
Incomplete
Needs Feeback
Priority
QA
Question
Task
Upstream/Dependancy
bug
duplicate
enhancement
invalid
pull-request
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/WiFiManager#614
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @marsrakete on GitHub (Sep 17, 2018).
Original GitHub issue: https://github.com/tzapu/WiFiManager/issues/736
Kindly asking for Feature Request
I was implementing WiFiManagerParameter for a project. Works really good! Until I discovered, that I accidentally left the MQTT-field empty. Which made it quite hard to change afterwards (had to switch of the Wifi-router to be able to connect to the ESP).
My suggestion is to integrate some basic validation method like:
...
If validation fails, the first input form is re-displayed, with error message(s).
Of course very rudimentary.
Hence new parameter like:
WiFiManagerParameter custom_mqtt_server("server", "mqtt server", mqtt_server, 40, REQUIRED | IP_ADDRESS);
(Bit-operation not required, just an idea. Might be confusing)
WiFimanager Branch/Release:
Esp8266/Esp32:
@tablatronix commented on GitHub (Sep 17, 2018):
just add
'requiredattributes to the html..@tablatronix commented on GitHub (Sep 18, 2018):
@marsrakete commented on GitHub (Sep 18, 2018):
The "required" attribute is not sufficient and requires manual changes in the WiFiManager.h, which is likely impractical when using the IDE and the library manager.
I guess the callback-method is the most practical way.
@tablatronix commented on GitHub (Sep 18, 2018):
well not really, the param class allows custom html attributes
WiFiManagerParameter::WiFiManagerParameter(const char *id, const char *placeholder, const char *defaultValue, int length, const char *custom) {also development branch contains all html in a strings.h file not source code
@marsrakete commented on GitHub (Sep 18, 2018):
Wow, development branch has greatly evolved!
Somehow I wasn’t aware about the custom html parameter. Now I read the class code, I understand what you’ve done by overloading.
Thank you. I’ll be patiently awaiting new master release. Issue may be closed.
@tablatronix commented on GitHub (Sep 18, 2018):
for example
WiFiManagerParameter custom_ipaddress("input_ip", "input IP", "", 19,"pattern='\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}'");you can also pass in the entire parameter as custom html
with
WiFiManagerParameter custom_html("<p>This Is Custom HTML</p>");@tablatronix commented on GitHub (Oct 5, 2018):
you can now add custom param child classes #741