diff --git a/WiFiManager.cpp b/WiFiManager.cpp index f202ce0..818d614 100644 --- a/WiFiManager.cpp +++ b/WiFiManager.cpp @@ -33,20 +33,20 @@ WiFiManagerParameter::WiFiManagerParameter(const char *custom) { _label = NULL; _length = 1; _value = NULL; - _labelPlacement = WFM_LABEL_BEFORE; + _labelPlacement = WFM_LABEL_DEFAULT; _customHTML = custom; } WiFiManagerParameter::WiFiManagerParameter(const char *id, const char *label) { - init(id, label, "", 0, "", WFM_LABEL_BEFORE); + init(id, label, "", 0, "", WFM_LABEL_DEFAULT); } WiFiManagerParameter::WiFiManagerParameter(const char *id, const char *label, const char *defaultValue, int length) { - init(id, label, defaultValue, length, "", WFM_LABEL_BEFORE); + init(id, label, defaultValue, length, "", WFM_LABEL_DEFAULT); } WiFiManagerParameter::WiFiManagerParameter(const char *id, const char *label, const char *defaultValue, int length, const char *custom) { - init(id, label, defaultValue, length, custom, WFM_LABEL_BEFORE); + init(id, label, defaultValue, length, custom, WFM_LABEL_DEFAULT); } WiFiManagerParameter::WiFiManagerParameter(const char *id, const char *label, const char *defaultValue, int length, const char *custom, int labelPlacement) { diff --git a/WiFiManager.h b/WiFiManager.h index ee69878..1588bad 100644 --- a/WiFiManager.h +++ b/WiFiManager.h @@ -129,6 +129,7 @@ #define WFM_LABEL_BEFORE 1 #define WFM_LABEL_AFTER 2 #define WFM_NO_LABEL 0 +#define WFM_LABEL_DEFAULT 1 class WiFiManagerParameter { public: diff --git a/examples/Super/OnDemandConfigPortal/OnDemandConfigPortal.ino b/examples/Super/OnDemandConfigPortal/OnDemandConfigPortal.ino index f1fbf1a..b92d34f 100644 --- a/examples/Super/OnDemandConfigPortal/OnDemandConfigPortal.ino +++ b/examples/Super/OnDemandConfigPortal/OnDemandConfigPortal.ino @@ -29,7 +29,7 @@ int TESP_CP_TIMEOUT = 90; // test cp timeout bool TEST_NET = true; // do a network test after connect, (gets ntp time) bool ALLOWONDEMAND = true; // enable on demand int ONDDEMANDPIN = 0; // gpio for button -bool WMISBLOCKING = false; // use blocking or non blocking mode +bool WMISBLOCKING = true; // use blocking or non blocking mode, non global params wont work in non blocking // char ssid[] = "*************"; // your network SSID (name) // char pass[] = "********"; // your network password @@ -90,7 +90,7 @@ void setup() { // wm.erase(); // setup some parameters - WiFiManagerParameter custom_html("
This Is Custom HTML
"); // only custom html + WiFiManagerParameter custom_html("This Is Custom HTML
"); // only custom html WiFiManagerParameter custom_mqtt_server("server", "mqtt server", "", 40); WiFiManagerParameter custom_mqtt_port("port", "mqtt port", "", 6); WiFiManagerParameter custom_token("api_token", "api token", "", 16); @@ -98,7 +98,29 @@ void setup() { WiFiManagerParameter custom_ipaddress("input_ip", "input IP", "", 15,"pattern='\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}'"); // custom input attrs (ip mask) const char _customHtml_checkbox[] = "type=\"checkbox\""; - WiFiManagerParameter custom_checkbox("checkbox", "my checkbox", "T", 2, _customHtml_checkbox, WFM_LABEL_AFTER); + WiFiManagerParameter custom_checkbox("my_checkbox", "My Checkbox", "T", 2, _customHtml_checkbox,WFM_LABEL_AFTER); + + const char *bufferStr = R"( + +Select Choice
+ +Select Choice
+