What's new

Welcome to the forum 👋, Visitor

To access the forum content and all our services, you must register or log in to the forum. Becoming a member of the forum is completely free.

Help coding a button

htmllearner

New member
Joined
May 12, 2020
Messages
1
Reaction score
0
HTML Coins
0
The following links into an "Arduino" project. I modified the following tutorial.

I am needing to add a second button i.e. changing the toggle switch to a button.

I copied the below part

String processor(const String& var){
//Serial.println(var);
if(var == "SLIDERPLACEHOLDER"){
String buttons ="";
String outputStateValue = outputState();
buttons+= "<h4>Lights <span id=\"outputState\"><span></h4><label class=\"switch\"><input type=\"checkbox\" onchange=\"toggleCheckbox(this)\" id=\"output\" " + outputStateValue + "><span class=\"slider\"></span></label>";
return buttons;
}

And started making changes so that it looks like
if(var == "BUTTONPLACEHOLDER"){
String buttons ="";
String outputStateValue = outputState();
buttons+= "<h4>Patten <span id=\"outputState\"><span></h4><label class=\"button\"><input type=\"button\" id=\"output\" " + outputStateValue + "><span class=\"button\"></span></label>"; //Need to display gCurrentPatternNumber somehow

As you will see, the Pattern button does display correctly

BrowserScreen.png

I am guessing that
  1. I have not changed the code correctly
  2. I need more CSS
  3. I need an extra script
I am not needing help with the "C" coding or the electronics, just the HTML, CSS and scripting.

Thanks :)
 

Attachments

Theme customization system

You can customize some areas of the forum theme from this menu.

  • Wide/Narrow view

    You can control a structure that you can use to use your theme wide or narrow.

    Grid view forum list

    You can control the layout of the forum list in a grid or ordinary listing style structure.

    Picture grid mode

    You can control the structure where you can open/close images in the grid forum list.

    Close sidebar

    You can get rid of the crowded view in the forum by closing the sidebar.

    Fixed sidebar

    You can make it more useful and easier to access by pinning the sidebar.

    Close radius

    You can use the radius at the corners of the blocks according to your taste by closing/opening it.

  • Choose the color combination that reflects your taste
    Background images
    Color gradient backgrounds
Back