[GH-ISSUE #764] Enhancement: Add input type param support #638

Closed
opened 2026-02-28 01:26:20 +03:00 by kerem · 11 comments
Owner

Originally created by @martinberlin on GitHub (Nov 4, 2018).
Original GitHub issue: https://github.com/tzapu/WiFiManager/issues/764

I was thinking that for most of the people that are building their apps using this library as a base for WiFi Connectivity but also to Setup certain things like configuration using your "param" menu option would be a nice addition to have checkboxes and drop-down lists.
You can, of course, think about it, since maybe it's out of scope. The main goal of this library is to provide a WiFi Manager that is already working very good.

The first 2 elements that come to my mind while doing a configuration are:

  1. ON/OFF checkbox
    <input type="checkbox" id="c1" name="c1" value="Turn on something"> Turn on something

  2. Options dropdown
    Select your car:

 <select>
  <option value="volvo">Volvo</option>
  <option value="saab">Saab</option>
  <option value="mercedes">Mercedes</option>
  <option value="audi">Audi</option>
</select>

(Mine would be out of this price range ;)

Originally created by @martinberlin on GitHub (Nov 4, 2018). Original GitHub issue: https://github.com/tzapu/WiFiManager/issues/764 I was thinking that for most of the people that are building their apps using this library as a base for WiFi Connectivity but also to Setup certain things like configuration using your "param" menu option would be a **nice addition** to have checkboxes and drop-down lists. You can, of course, think about it, since maybe it's out of scope. The main goal of this library is to provide a WiFi Manager that is already working very good. The first 2 elements that come to my mind while doing a configuration are: 1. ON/OFF checkbox `<input type="checkbox" id="c1" name="c1" value="Turn on something"> Turn on something` 2. Options dropdown **Select your car:** ``` <select> <option value="volvo">Volvo</option> <option value="saab">Saab</option> <option value="mercedes">Mercedes</option> <option value="audi">Audi</option> </select> ``` (Mine would be out of this price range ;)
kerem 2026-02-28 01:26:20 +03:00
Author
Owner

@tablatronix commented on GitHub (Nov 4, 2018):

you should be able to add custom param support yourself without needing to modify the lib using the new param childclass capability

https://github.com/tzapu/WiFiManager/blob/development/examples/ParamsChildClass/ParamsChildClass.ino

<!-- gh-comment-id:435672443 --> @tablatronix commented on GitHub (Nov 4, 2018): you should be able to add custom param support yourself without needing to modify the lib using the new param childclass capability https://github.com/tzapu/WiFiManager/blob/development/examples/ParamsChildClass/ParamsChildClass.ino
Author
Owner

@martinberlin commented on GitHub (Nov 6, 2018):

Thanks very nice example, will try it out and give you feedback about it. Happy that is already possible!

<!-- gh-comment-id:436094497 --> @martinberlin commented on GitHub (Nov 6, 2018): Thanks very nice example, will try it out and give you feedback about it. Happy that is already possible!
Author
Owner

@tablatronix commented on GitHub (Nov 6, 2018):

Yeah I was looking at this today to see if it can be improved since there is no way to pass in the html strings

<!-- gh-comment-id:436098565 --> @tablatronix commented on GitHub (Nov 6, 2018): Yeah I was looking at this today to see if it can be improved since there is no way to pass in the html strings
Author
Owner

@martinberlin commented on GitHub (Nov 6, 2018):

I would like to see a input type="checkbox" example :)
I still didn't find the time to try it. But I found sometime to make a SPIFFs file manager, you can try it out when your camera arrives!

<!-- gh-comment-id:436318816 --> @martinberlin commented on GitHub (Nov 6, 2018): I would like to see a input type="checkbox" example :) I still didn't find the time to try it. But I found sometime to make a SPIFFs file manager, you can try it out when your camera arrives!
Author
Owner

@tablatronix commented on GitHub (Nov 6, 2018):

WiFiManagerParameter custom_field("customfieldid", "Custom Field Label", "Custom Field Value", customFieldLength,"placeholder=\"Custom Field Placeholder\" type=\"checkbox\"");

oh you can just add the type in custom html param, but for select it will have to be totally different

<!-- gh-comment-id:436338526 --> @tablatronix commented on GitHub (Nov 6, 2018): ```C++ WiFiManagerParameter custom_field("customfieldid", "Custom Field Label", "Custom Field Value", customFieldLength,"placeholder=\"Custom Field Placeholder\" type=\"checkbox\""); ``` oh you can just add the `type` in custom html param, but for select it will have to be totally different
Author
Owner

@tablatronix commented on GitHub (Nov 6, 2018):

for custom html just add your own html

WiFiManagerParameter custom_html("<br/><label for='customfieldid'>Custom Field Label</label><input id='customfieldid' name='Custom Field Label' value='Custom Field Value'"); // custom html input
<!-- gh-comment-id:436340740 --> @tablatronix commented on GitHub (Nov 6, 2018): for custom html just add your own html ```c++ WiFiManagerParameter custom_html("<br/><label for='customfieldid'>Custom Field Label</label><input id='customfieldid' name='Custom Field Label' value='Custom Field Value'"); // custom html input ```
Author
Owner

@tablatronix commented on GitHub (Nov 6, 2018):

if you want to make a child class to add additional types and add gettters to convert submission to whatever datatype you want, boolean , option id to text etc. then you have to use that example.

if you want to make a child class for option selects, you would need some kind of array and then push the options in then iterate and generate the custom html etc

<!-- gh-comment-id:436341509 --> @tablatronix commented on GitHub (Nov 6, 2018): if you want to make a child class to add additional types and add gettters to convert submission to whatever datatype you want, boolean , option id to text etc. then you have to use that example. if you want to make a child class for option selects, you would need some kind of array and then push the options in then iterate and generate the custom html etc
Author
Owner

@tablatronix commented on GitHub (Nov 6, 2018):

The only issue with this is that customhtml params do not have ids, so you cannot getValue etc and have to to it youself

<!-- gh-comment-id:436346271 --> @tablatronix commented on GitHub (Nov 6, 2018): The only issue with this is that customhtml params do not have ids, so you cannot getValue etc and have to to it youself
Author
Owner

@tablatronix commented on GitHub (Nov 6, 2018):

I updated advanced.ino example with a basic custom html input sample

<!-- gh-comment-id:436350918 --> @tablatronix commented on GitHub (Nov 6, 2018): I updated advanced.ino example with a basic custom html input sample
Author
Owner

@martinberlin commented on GitHub (Nov 7, 2018):

Great thank you I will try this out tonight and close this. Sorry totally forgot about this one sending it per email home to test it tonight

<!-- gh-comment-id:436519708 --> @martinberlin commented on GitHub (Nov 7, 2018): Great thank you I will try this out tonight and close this. Sorry totally forgot about this one sending it per email home to test it tonight
Author
Owner

@martinberlin commented on GitHub (Nov 19, 2018):

Works as expected. Good job!
Thanks a lot Shawn

<!-- gh-comment-id:440043652 --> @martinberlin commented on GitHub (Nov 19, 2018): Works as expected. Good job! Thanks a lot Shawn
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#638
No description provided.