mirror of
https://github.com/tzapu/WiFiManager.git
synced 2026-04-27 17:15:53 +03:00
[GH-ISSUE #1417] Disable Save button until user fills ssid, pass, and also custom input fields #1210
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#1210
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 @kargarisaac on GitHub (May 13, 2022).
Original GitHub issue: https://github.com/tzapu/WiFiManager/issues/1417
Hi,
Is it possible to disable the save button until user fills the input fields? I have added also some custom input fields using:
@kargarisaac commented on GitHub (May 14, 2022):
I tried to modify the
strings_en.hfile like this:But I cannot see any changes there. Also, I tried to just disable the save button using html but I don't see any change there too. around lines 70-80 in
strings_en.hfile:Am I missing sth?
@tablatronix commented on GitHub (May 14, 2022):
you might have to add css for disabled state
@kargarisaac commented on GitHub (May 15, 2022):
When I remove the style part, I see that the button is disabled. But I cannot enable it using javascript. Do you think I put the code in a right place? I remove the custom input box and just use ssid and password inputs but no result yet.
@tablatronix commented on GitHub (May 15, 2022):
disabled style was only for inputs, I updated it, pull master
github.com/tzapu/WiFiManager@c56eec9018Can you post your js in plain js formatting.
Use the html template for testing, its easier
@tablatronix commented on GitHub (May 15, 2022):
I will have the strings reworked later toda with the easier includes also
@kargarisaac commented on GitHub (May 15, 2022):
I used the code from here.
My code:
added
idfor save button in cpp code.and appended the following js code to the
HTTP_SCRIPT[]code inside the function:@kargarisaac commented on GitHub (May 15, 2022):
Seems that the problem is putting script in head. When I put it at the end of body, it works in the html template. In cpp file, it is a bit complex. I don't know yet the logic there and have to go deeper in the code to change it.
@tablatronix commented on GitHub (May 15, 2022):
maybe add an onload event wrapper ?
@kargarisaac commented on GitHub (May 16, 2022):
Thanks for the tip. Now it works. Here is the code in html template: