I've been trying to setup a dropdown using websocket. I have been able to set up sliders with WS, and dropdowns in HTML. I've searched and can't find anything related. I'm using an ESP32 if that makes any difference. Thanks
what is a "dropdown" ? I could start speculating but I will not speculate.
what does the abbreviation "WS" mean?
drowdowns in HTML
HTML is a website defining language that is interpreted by a browser
websocket is a certain kind of software / protocol for transferring data using network-technoligies
This means websocket is something very different than HTML.
To make an everyday analogon:
a washing-machine has to do with "water"
a public swimming pool has to do with "water" too
Your question is almost like asking
I have problems with my knee-joints and my arm-joints I need a possability to improve my personal fitness with reduced load on my joints. I know I could go swimming I tried it and it is quite useful
But I want to do this at home how can I use my washing-machine for doing this?
Makes no sense at all.
nice response. If you are unable to add something constructive, keep your mouth shut. Here is a link describing a dropdown in HTML:
How to Make a Dropdown Menu in Html - javatpoint
WS is an acronym for WebSocket. [Mod edit, rude comment removed]
So do you mean you don't want the drop-down-menu be created by a client-request
but instead the websocket-connection shall create the drop-down-menu initiated by the server?
I guess the drop-down-menu will still be HTML. If not you have to expand the text of your posting providing more information how the drop-down-menu shall be created without HTML
Anyway your question seems to be not really related to Arduino microcontroller- C++ programming. If it is related to Arduino microcontroller-C++programming post your sketch how you tried it. There are users here that have experience with html, TCP etc.
2nd attempt at this. I'm using an ESP32 to create an asynchronous web server, with the webpage used to control modes of the ESP32. On the webpage served, there are sliders that utilize WebSocket. I do this so when I load the webpage, the previous slider settings are shown and not the default. I now wish to do so with a dropdown menu, for which I have written the HTML. I'm unsure how to create the same behavior with the dropdown menu as I have with the sliders.
lot's of different approaches possible
- big array of char containing the html-code located in RAM or flash using a processing-function to replace %placeholders%
- concanating a string from pieces containing the html-code
- reading in parts of the html-code from files stored in SPIFFS or littleFS
It will become much easier to answer if you post your current sketch
There is an automatic function for doing this in the Arduino-IDE
just three steps
- press Ctrl-T for autoformatting your code
- do a rightclick with the mouse and choose "copy for forum"
- paste clipboard into write-window of a posting
best regards Stefan
Your two topics on the same or similar subject have been merged.
Please do not duplicate your questions as doing so wastes the time and effort of the volunteers trying to help you as they are then answering the same thing in different places.
Repeated duplicate posting could result in a temporary or permanent ban from the forum.
Could you take a few moments to Learn How To Use The Forum
It will help you get the best out of the forum in the future.
Thank you.
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.