mirror of
https://github.com/tzapu/WiFiManager.git
synced 2026-04-27 00:55:52 +03:00
[GH-ISSUE #78] Any Way to add Custom Fields to be saved #54
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#54
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 @yomasa on GitHub (Jan 19, 2016).
Original GitHub issue: https://github.com/tzapu/WiFiManager/issues/78
I want to save the "mqtt_server" , "mqtt_port", "mqtt_user","mqtt_password" ?
Thanks
Jorge
@Jorgen-VikingGod commented on GitHub (Jan 20, 2016):
there is already support for custom fields:
https://github.com/tzapu/WiFiManager/blob/master/examples/AutoConnectWithFSParameters/AutoConnectWithFSParameters.ino#L73-L93
@tzapu commented on GitHub (Jan 20, 2016):
thanks Jorgen , mentioned in docs here https://github.com/tzapu/WiFiManager#custom-parameters
@Jorgen-VikingGod commented on GitHub (Jan 20, 2016):
@tzapu Wow, did not see the updated doc yet.
Awesome work - really like what you did
@tzapu commented on GitHub (Jan 20, 2016):
thanks, could not have done it without all your guy's help
@drvpn commented on GitHub (Jun 21, 2022):
I would love to see an example where a custom field input type was password. I have figured out how to add the field to the webpage but I cannot figure out how to store the password in a variable. custom_field.getValue() doesn't work.
Below is snippet of code how I added the field.
Does anyone know how I can get the pwd's value and store it in variable?
Thanks!
@tablatronix commented on GitHub (Jun 21, 2022):
See the fs examples, spiffs etc
@drvpn commented on GitHub (Jun 21, 2022):
Thanks @tablatronix but unfortunately that example doesn't help. Below is all the parameters that is configured in https://github.com/tzapu/WiFiManager/blob/master/examples/Parameters/SPIFFS/AutoConnectWithFSParameters/AutoConnectWithFSParameters.ino and this method only works to create input type="text" not input type="password". I am looking to input an actual password, so people cannot shoulder surf and see the password.
Since I cannot use the above method to create a field with input type="password" I have found that I can add a password field like this:
This works but I cannot figure out how to get the value out of the webpage and into a variable. This follow method won't work:
strcpy(mqtt_server, custom_field.getValue());So looks like I am stuck here unless I can find a way to retrieve the input value, when the form is submitted, and store it in a variable. Any ideas?
@tablatronix commented on GitHub (Jun 21, 2022):
you can just add
type='password'to the custom html parameter? not sure if there is another way to add password to an input.@drvpn commented on GitHub (Jun 21, 2022):
Thanks again @tablatronix I found a solution in an example that used radio buttons. It used the follow code and it seems to work with my custom password field as well. Here is the function that was required:
Here is the link to the solution I found: https://github.com/tzapu/WiFiManager/issues/1158#issuecomment-1047708779
Thanks so much for all your time!
@tablatronix commented on GitHub (Jun 21, 2022):
adding to the SUPER example
@drvpn commented on GitHub (Jun 21, 2022):
@tablatronix That works like a charm and is far more intuitive than the getParam solution. Today you are my code hero, thanks so much! 🥇