TomDuncan Active Member Licensed User Longtime User Apr 1, 2021 #1 Hi all. I have a web page using websockets. I have a maindiv and inside that I have buttons and a checkbox input. The button show up in the maindiv_click subroutine but the input device does not and does not change on/off here is the code HTML: Copy <div id="maindiv"> <button id="#rgb_03_on">3 on</button> <button id="rgb_03_off">3 off</button> <button id="&build">3 stat</button> <input id="toggle-trigger" type="checkbox" data-toggle="toggle"> </div> any thoughts on how I can get and set the input (for on/off state) Tom
Hi all. I have a web page using websockets. I have a maindiv and inside that I have buttons and a checkbox input. The button show up in the maindiv_click subroutine but the input device does not and does not change on/off here is the code HTML: Copy <div id="maindiv"> <button id="#rgb_03_on">3 on</button> <button id="rgb_03_off">3 off</button> <button id="&build">3 stat</button> <input id="toggle-trigger" type="checkbox" data-toggle="toggle"> </div> any thoughts on how I can get and set the input (for on/off state) Tom
DonManfred Expert Licensed User Longtime User Apr 1, 2021 #2 The snippet is just a part of a Formular. The important parts of the formular are missing. How could one help with this less Information? Upvote 0
The snippet is just a part of a Formular. The important parts of the formular are missing. How could one help with this less Information?
TomDuncan Active Member Licensed User Longtime User Apr 1, 2021 #3 I shall try and be more succinct. I have rocker switches on a web page that I need to turn on OR off. If I have these in a <div> with an id of maindiv which I use in code using a Sub MainDiv_click event the switch will not change state. I assume the event is being captured by websockets. (No idea, I am but a trainee) So my main want is to get a response in code for the id= "toggle-trigger". Then I may be able to turn lights on an off via MQTT. I am using Bootstrap 3 I hope this might fill in some gaps in my question. yours Tom Last edited: Apr 2, 2021 Upvote 0
I shall try and be more succinct. I have rocker switches on a web page that I need to turn on OR off. If I have these in a <div> with an id of maindiv which I use in code using a Sub MainDiv_click event the switch will not change state. I assume the event is being captured by websockets. (No idea, I am but a trainee) So my main want is to get a response in code for the id= "toggle-trigger". Then I may be able to turn lights on an off via MQTT. I am using Bootstrap 3 I hope this might fill in some gaps in my question. yours Tom
TomDuncan Active Member Licensed User Longtime User Apr 2, 2021 #4 Oops I must say I am sorry with the question. It seems to be the use of a "checkbox" with a div that the program is checking. I do a Maindiv_click sub. If this id is left blank then the checkbox does toggle, however, if this checkbox is within the <div id="maindiv"> then the toggle does not happen. Tom Last edited: Apr 2, 2021 Upvote 0
Oops I must say I am sorry with the question. It seems to be the use of a "checkbox" with a div that the program is checking. I do a Maindiv_click sub. If this id is left blank then the checkbox does toggle, however, if this checkbox is within the <div id="maindiv"> then the toggle does not happen. Tom