WiFiManager icon indicating copy to clipboard operation
WiFiManager copied to clipboard

Pull Down Menu Example

Open DanielLester83 opened this issue 7 months ago • 2 comments

Thought I'd share this html injection method to have a selection pull down menu while still setiing the value to a paremeter.

Explaination:

  1. It creates a 'text' labeled 'ahot' that is made invisible with "style='width: 0px; padding: 0px; border: none'"
  2. It closes the first tag
  3. It creates a 'select' tag labled "sel"
  4. When an option is selected it triggers code to set the 'text' input to be the value of that option
  5. Next it creates the different option tags with values
  6. Then It ends the 'select' tag
  7. It runs a script to set the value of the 'select' input to be the value of the 'text' tag so they are the same when the page loads
  8. It finally ends the script tag leaving the '>' symbol off because the code adds it latter

`WiFiManagerParameter aHotkey( "ahot", "Hotkey", "F12", 32, "readonly style='width: 0px; padding: 0px; border: none'>

DanielLester83 avatar Dec 04 '23 07:12 DanielLester83

You could just use customhead to inject js in case this breaks in the future

tablatronix avatar Dec 04 '23 13:12 tablatronix

You could just use customhead to inject js in case this breaks in the future

The way it's written here the script runs after the input and select are created, which seemed necessary in my tests.

DanielLester83 avatar Dec 04 '23 14:12 DanielLester83