[GH-ISSUE #944] Set "checked" flag on Parameter #801

Closed
opened 2026-02-28 01:27:06 +03:00 by kerem · 1 comment
Owner

Originally created by @ElVasquito on GitHub (Sep 18, 2019).
Original GitHub issue: https://github.com/tzapu/WiFiManager/issues/944

I added the 3 radio buttons as parameters, based on the "Advanced.ino" example (dev branch), and they appear OK, but how can I set the "checked" flag depending on value 1, 2 or 3 that is loaded from config.json file? So that each time the Param page loads, the proper button is preselected instead of always the first one...

const char* custom_radio_str = "<br/><label for='customfieldid'>Custom Field Label</label><input type='radio' name='customfieldid' value='1' checked> One<br><input type='radio' name='customfieldid' value='2'> Two<br><input type='radio' name='customfieldid' value='3'> Three"; new (&custom_field) WiFiManagerParameter(custom_radio_str); // custom html input wm.addParameter(&custom_field);

Originally created by @ElVasquito on GitHub (Sep 18, 2019). Original GitHub issue: https://github.com/tzapu/WiFiManager/issues/944 I added the 3 radio buttons as parameters, based on the "Advanced.ino" example (dev branch), and they appear OK, but how can I set the "checked" flag depending on value 1, 2 or 3 that is loaded from config.json file? So that each time the Param page loads, the proper button is preselected instead of always the first one... ` const char* custom_radio_str = "<br/><label for='customfieldid'>Custom Field Label</label><input type='radio' name='customfieldid' value='1' checked> One<br><input type='radio' name='customfieldid' value='2'> Two<br><input type='radio' name='customfieldid' value='3'> Three"; new (&custom_field) WiFiManagerParameter(custom_radio_str); // custom html input wm.addParameter(&custom_field); `
kerem closed this issue 2026-02-28 01:27:07 +03:00
Author
Owner

@tablatronix commented on GitHub (Sep 20, 2019):

ok and ? lol not sure what this is for

<!-- gh-comment-id:533721538 --> @tablatronix commented on GitHub (Sep 20, 2019): ok and ? lol not sure what this is for
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/WiFiManager#801
No description provided.