B4J Question Getting response and value from Input

TomDuncan

Active Member
Licensed User
Longtime User
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:
            <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
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

TomDuncan

Active Member
Licensed User
Longtime User
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:
Upvote 0

TomDuncan

Active Member
Licensed User
Longtime User
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:
Upvote 0
Top