Anniversary Sale · up to 80% off all librariesEnds Nov 9Shop now
SOFTTDocs
Settings Fields

Password Input

Collect sensitive text, such as passwords or API keys, in a masked field on the NetWizard settings page.

NetWizard Pro feature. This functionality is available only in the commercial edition of NetWizard.

NetWizardPassword works like a String input but masks the text the user enters. Use it for passwords, tokens and other sensitive settings.

Password input field

Constructor

NetWizardPassword(NetWizard* parent, const char* name, const char* value = "",
                  const char* placeholder = "", bool required = true);

Prop

Type

NetWizardPassword mqtt_password(&NW, "MQTT Password", "", "Enter password");

Methods

getValue()

String password = mqtt_password.getValue();

Returns a copy of the current value.

setValue()

mqtt_password.setValue("secret");

Sets the value of the field.

See Settings Fields for the methods shared by all fields.

Example

main.cpp
#include <WebServer.h>
#include <NetWizardPro.h>

WebServer server(80);
NetWizard NW(&server);

NetWizardInput    mqtt_user(&NW, "MQTT User", "", "user");
NetWizardPassword mqtt_password(&NW, "MQTT Password", "", "Enter password");

void setup() {
  NW.onConfig([&]() {
    // store mqtt_user.getValue() and mqtt_password.getValue()
    return true;
  });

  NW.autoConnect("NetWizard Demo", "");
  server.begin();
}

void loop() {
  NW.loop();
}

On this page