WiFiManager
WiFiManager copied to clipboard
Pull Down Menu Example
Thought I'd share this html injection method to have a selection pull down menu while still setiing the value to a paremeter.
Explaination:
- It creates a 'text' labeled 'ahot' that is made invisible with "style='width: 0px; padding: 0px; border: none'"
- It closes the first tag
- It creates a 'select' tag labled "sel"
- When an option is selected it triggers code to set the 'text' input to be the value of that option
- Next it creates the different option tags with values
- Then It ends the 'select' tag
- 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
- 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'>
You could just use customhead to inject js in case this breaks in the future
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.