tzapu / WiFiManager

ESP8266 WiFi Connection manager with web captive portal
http://tzapu.com/esp8266-wifi-connection-manager-library-arduino-ide/
MIT License
6.55k stars 1.97k forks source link

Pull Down Menu Example #1685

Open DanielLester83 opened 10 months ago

DanielLester83 commented 10 months ago

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'> Githubissues.

  • Githubissues is a development platform for aggregating issues.