Components filled with Tampermonkey script are not recognized as filled

I filled out the registration form on the site https://register.gotowebinar.com/register/2965111702634965004 automatically with a script.

// ==UserScript==
// @name         Duolos autofill registration form
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  try to take over the world!
// @author       blaz
// @match        https://register.gotowebinar.com/register/*
// @icon         https://www.google.com/s2/favicons?sz=64&domain=gotowebinar.com
// @grant        none
// @run-at       document-end
// ==/UserScript==

setTimeout(function(){
console.log("10s later...");

var formFirstName = document.getElementById('registrant.firstName')
var formEmail = document.getElementById('registrant.email')

formFirstName.value = 'My_first_name'
formEmail.value = '[email protected]'

}, 10000);

However, when I want to confirm the form with the button on the page, I get a message that the fields filled in by the script have no content and I have to fill them in to go further. Is there any way around it?

required fields

JavaScript converting the string “constructor” to [Function: Object]

I’m building a parser for a simple interpreter in JavaScript. I have a preprocessor method that removes specific tokens from an input list of tokens produced by the tokenizer:

const tokenizer = new Tokenizer();
let program = [];
let symbols = {};

tokenizer.init(mainFile, null);
let tokens = tokenizer.exec(mainFile);

for (let i = 0; i < tokens.length; i++) {
    const lookahead = [
        tokens[i+1],
        tokens[i+2]
    ];
    if (tokens[i].type == 'PRE_DEFINE') {
        if (lookahead[0].type == 'IDENTIFIER') {
            symbols[tokens[i+1].value] = String(lookahead[1].value);
            i+=3;
        } else {
            throw new PreprocessorError(`Unexpected token "${lookahead[0].value}"`);
        }            
    }

    if (tokens[i].type == 'IDENTIFIER' && String(tokens[i].value) in symbols) {
        program.push(symbols[tokens[i].value]);
    } else {
        program.push(tokens[i].value);
    }
}
return program;

Each token is an object like this, with both type and value being strings:

// Affected constructor identifier token
{
    type: 'IDENTIFIER',
    value: 'constructor'
},
// Number token
{
    type: 'NUMBERLITERAL',
    value: '10'
}

Somewhere in this function, when tokens[i].value == 'constructor', said value is being converted to the actual JS keyword constructor (I would assume) and is showing up in debug as [Function: Object]. The word ‘constructor’ appearing in a token has caused no issues elsewhere in the code where it’s handled and appears normal when console.log‘d directly before this loop, so I’m quite confused. Could someone point me in the direction of an explanation here?

I have added several calls to String() to attempt to force 'constructor' to remain a string, but nothing seems to work.

I would assume that I’ve missed something in my code, but is it possible this is a JS issue?

Thanks!

Warning: Maximum update depth exceeded

I am trying to display a hierarchy accompanied with checkboxes, in Canvas element.

In order to do that, I have a recursive function drawItem in my main App.js file that display my hierarchy.

I have implemented a useCanvas hook that return the canvas attribute. For instance, the handleCanvasClick function is deserved to handle clicks on Canvas element and detect if one of the checkboxes has been clicked.

So far, my architecture seems good to me. Despites, Reacts shows me ‘Warning: Maximum update depth exceeded.’ on browser console. Have you any improvement to implement in a better manner ?

See code at https://codesandbox.io/s/ybdyik

Javascript 8 ToggleViews inside of 8 ToggleBoxes

I have both of these functions working independent of each other but I cannot get them to work together (I am a very jr. programmer, so please be kind and descriptive).

I have 8 div’s with unique id’s. I can Toogle these from open to closed without issue using Class and Id tags. Inside of each of these Div’s are three other Div’s. One will be visible upon opening the Div and two will be hidden. I have a hyperlink (that works, but all 8 containers only operate in the last Div box instead of their own) to ToggleVisible – using get element by id and change display property – on the 3 div’s inside the Parent div (and it works but only in my 8th container.). Is there a way to change the display: by Class and Id in by modifying my existing code (I am not a javascript guru, very very jr)?

    <div style="border-color:#999999;  border:6px" >

                <li class="breadcrumbs boxHeader " style=" box-shadow: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24); width:100%; position: relative; border-color:#FFFFFF; border:none">
                   <a href="#" onClick="return false" onMouseDown="javascript:toggleSlideBox('picBox8');" style="text-decoration:none; width:80%;"><div align="left" >
                   <img src="images/toggleBtn1.png" alt="Toggle" width="22" height="25" border="0" style="position:relative;  vertical-align:middle;" /> End of Life
                   </div></a>
                   <div align="right" style="width:20%;">
                   <a href="#" onClick="return false" onMouseDown="javascript:switchVisible('stageBox8');" style="text-decoration:none; font-size:9px; padding-right:2px;">All / By Stage</a>
                   </div>
                </li>
            
            <div class="editBox" id="picBox8"  style="border-color:#CCCCCC;  border-style:solid; border-width: 1px;">
            
                       <div class="stageBox" id="stageBox8" >

                            <li class="breadcrumbs">
                              <a href="#" id="1" onClick="return false" onMouseDown="javascript:toggleSlideBox();"  value="Click"  class="breadcrumbs__item gray">1</a>
                              <a href="#" id="2" onClick="return false" onMouseDown="javascript:toggleSlideBox();" value="Click"   class="breadcrumbs__item gray">2</a> 
                              <a href="#" id="3" onClick="return false" onMouseDown="javascript:toggleSlideBox();" value="Click"   class="breadcrumbs__item gray">3</a>
                              <a href="#" id="4" onClick="return false" onMouseDown="javascript:toggleSlideBox();" value="Click" class="breadcrumbs__item gray">4</a> 
                              <a href="#" id="5" onClick="return false" onMouseDown="javascript:toggleSlideBox();" value="Click" class="breadcrumbs__item gray">5</a> 
                            </li><br />
                       </div>
                        
                            <li class="ticketwrap " id="eol"> 
                                <?php include "ticket_g.php"; ?>
                                <?php include "ticket_y.php"; ?>
                                <?php include "ticket_r.php"; ?>
                                <?php include "ticket_g.php"; ?>
                                <?php include "ticket_r.php"; ?>
                                <?php include "ticket_g.php"; ?>
                                <?php include "ticket_g.php"; ?>
                            </li>
                            
                            <div class="taskBox" id="taskBox8">
                            <?php include "task-panel.php"; ?>
                            </div>
            </div>
    </div>

script

<script type="text/javascript">
function toggleSlideBox(x) {
        if ($('#'+x).is(":hidden")) {
            $(".editBox").slideUp(200);
            $('#'+x).slideDown(300);
        } else {
            $('#'+x).slideUp(300); // if you want all other open divs to close on new click - remove the function below this //
        }
}
function toggleSlideBox(x) {
        if ($('#'+x).is(":hidden")) {
            $("ticketwrap").slideUp(200);
            $('#'+x).slideDown(300);
        } else {
            $('#'+x).slideUp(300);
        }
}

// this is to try to hide the ticketwrapper at the same time it shows the taskbox - figure out code - it works but just on taskBox8 #id's aren't working //
function switchVisible(x) {
            if (document.getElementById('stageBox1')) {

                if (document.getElementById('taskBox1').style.display == 'none') {
                    
                    document.getElementById('stageBox1').style.display = 'block';
                    document.getElementById('taskBox1').style.display = 'block';
                    document.getElementById('ideation').style.display = 'none';
                }
                else {
                    document.getElementById('stageBox1').style.display = 'none';
                    document.getElementById('taskBox1').style.display = 'none';
                    document.getElementById('ideation').style.display = 'flex';
                }
            }
}
function switchVisible(x) {
            if (document.getElementById('stageBox2')) {

                if (document.getElementById('taskBox2').style.display == 'none') {
                    
                    document.getElementById('stageBox2').style.display = 'block';
                    document.getElementById('taskBox2').style.display = 'block';
                    document.getElementById('proj_gov_plan').style.display = 'none';
                }
                else {
                    document.getElementById('stageBox2').style.display = 'none';
                    document.getElementById('taskBox2').style.display = 'none';
                    document.getElementById('proj_gov_plan').style.display = 'flex';
                }
            }
} etc...

Again, the ToggleVisible all works… but only in Div8. So Div 1,2,3,4,5,6,7,8 all toggleVisible Div 8 only. The desired outcome is for the stageBox and taskBox to be visible when ticketwrap is hidden and visa versa.

Is there a way to use the class + id to change the display properties?

(I’m very jr. so please be nice)

How to get data from API “PokeAPI”

I have React component :

import React from "react";
import { Pokemons } from "../Pokemons";

class Main extends React.Component {
  state = {
    pokemons: [],
  };

  componentDidMount() {
    fetch("https://pokeapi.co/api/v2/pokemon?limit=20")
      .then((responce) => responce.json())
      .then((data) => this.setState({ pokemons: Object.values(data) }));
  }

  render() {
    return (
      <main className="container content">
        <Pokemons pokemon={this.state.pokemons} />
      </main>
    );
  }
}

export { Main };

The API I’m using is PokeAPI

My task is to display data about the first 20 Pokémon (which is what I’m trying to do in fetch() ). But I don’t get exactly what I need:

Console information.png

That is, JSON with four elements comes in response, the one I need is in the last one ( 3: ):

Console information 2.png

**In addition, each of the twenty objects (Pokémon) has a name and a link: **

Console Information 3.png

From this I need only the name, the rest of the necessary information (type, height, sprite) are data on these links. Example data in the link:

Data from link.png

In fact, the name of the pokemon is also in the data contained in these links.

I have never come across such an API structure before =(

Question – Help me get the name, type, sprite, height and weight of the Pokémon…

Sendinblue redirect

I included the Sendinblue Plugin to my WordPress Site which has the Avada Theme, so I found out, that the Plugin of Sendinblue has a few problems with some themes.
When I submit a Contactform formular to send it, I get this message:

{“status”:”success”,”msg”:{“successMsg”:””,”errorMsg”:””,”existMsg”:””,”invalidMsg”:””},”redirect”:””}

The only similair question I found was -> https://wordpress.org/support/topic/displays-plain-success-error-exist-messages-after-sending-form/ but there was no working solution.

Did somebody had the same issue before ?

Javascript between cells in Google Colab

I’m trying to get ipyvizzu, a JS charting library’s Jupyter Notebook integration, to work inside Google Colab. It depends on Jupyter’s behavior that generated javascript codes are put in the same scope throughout the notebook. Basically, the code snippet below would work in Jupyter Notebook. However, it does not work in Google Colab, because Colab seems to put every cell output in a separate iframe. Can I change this behavior of Colab somehow? Or is there any solution to this problem?

from IPython.display import display_javascript
display_javascript("var a = 10", raw=True)
display_javascript("console.log(a)", raw=True)

Error evaluating Javascript output: ReferenceError: a is not defined

(not) working example:
https://colab.research.google.com/drive/1FcAuHwqinsnBiaBALUguFzIw1wzoU1sj?usp=sharing

Triggering Action on click of button from CRM Portal website

There was a requirement to send an email to specified users(Support contacts) when user click on Submit feedback button. I was wondering if there is any way to trigger an Custom Action on click of the button on Portal Website form.

I tried with javascript emailto but it opens new outlook window for sending email, i want to send it as a background process.

If there is any alternative way to do it that would be helpful.

enter image description here

Making bold text in JavaScript

I’ve never done something in JavaScript, thus apologies if my question is very basic.

I’m trying to manipulate (making words bold, or introducing numeration structure) the description (description:”____”) part in the following code.

module.exports = {
  siteTitle: 'Hi! I'm Francisco!',
  siteDescription: `Create your online curriculum in just a few minutes with this starter`,
  keyWords: ['gatsbyjs', 'react', 'curriculum'],
  authorName: 'Francisco Santos',
  twitterUsername: '_franciscodf',
  githubUsername: 'santosfrancisco',
  authorAvatar: '/images/avatar.jpeg',
  authorDescription: `Developer, passionate about what I do. Always interested in how the sites were made, I started to study HTML by hobby. <br />
    In 2012 I started working as a support technician and I approached the developers.
    In 2015, I started to study C # and started to contribute with the team giving maintenance in an application in C # and .NET. <br />
    I currently work as a frontend developer and mainly work with <strong>Javascript, NodeJS e React.</strong>`,
  skills: [
    {
      name: 'HTML',
      level: 70
    },
    {
      name: 'CSS',
      level: 60
    },
    {
      name: 'Javascript',
      level: 50
    },
    {
      name: 'NodeJs',
      level: 40
    },
    {
      name: 'React',
      level: 60
    },
    {
      name: 'Git',
      level: 70
    },
    /* more skills here */
  ],
  jobs: [
    /* more jobs here */
    {
      company: "Gympass",
      begin: {
        month: 'sep',
        year: '2019'
      },
      duration: null,
      occupation: "Frontend developer",
      description: "<b>str</b> I am <b>part</b> of the bold(Corporate team), responsible for the development and maintenance of the employee management platform, giving more and more autonomy to partner +43 677 62431314companies."
  
    },  {
      company: "Lendico",
      begin: {
        month: 'apr',
        year: '2018'
      },
      duration: null,
      occupation: "Frontend developer",
      description: "I integrate the Frontend team responsible for developing and maintaining the online lending platform."
  
    }, 
  ],

I’ve already tried the basic syntax to do that usually, but since this obviously doesn’t work, I’m wondering if there is a simple way to do it within the “description:”

How do I remove non-uniform spacing between my table elements?

I am trying to make a paint website and for showing the colour palette, I use an HTML table of buttons that looks something like the following:
enter image description here

As you can see, the first three elements of both the rows are not uniformly spaced as the other elements in that row. To see why this problem must be occurring, I also used inspect but I couldn’t figure it out from there too because that gap wasn’t being shown in the margin, border or padding of the buttons.

enter image description here

I can’t understand this gap mainly because I have used uniform spacing and sizes for all the elements(You can see in the code snippet below). How do I correct this?

html {
    min-width: 1500px;
    position: relative;
    }

#toolset {
    width     : 100px;
    height    : 340px;
    position  : absolute;
    left      : 0px;
    top       : 50px; 
    background: #35d128;
}

#paint {
    position  : absolute;
    left      : 130px;
    top       : 50px;
}

#colorset {
    position  : absolute;
    left      : 0px;
    top       : 450px;
    width     : 300px;
}

#colorset td {
    width     : 18px;
    height    : 20px;
}
 
#title {
    position  : absolute;
    left      : 500px;
}

#penciltool {
    background: #358128; 
    color     : #f3f3f3;
    width     : 80px;
    height    : 25px;
    border    : 1px solid #33842a;
    -webkit-border-radius: 0 15px 15px 0;
    -moz-border-radius: 0 15px 15px 0;
    box-shadow: rgba(0, 0, 0, .75) 0 2px 6px;
}

#linetool {
    background: #358128; 
    color     : #f3f3f3;
    width     : 80px;
    height    : 25px;
    border    : 1px solid #33842a;
    -webkit-border-radius: 0 15px 15px 0;
    -moz-border-radius: 0 15px 15px 0;
    box-shadow: rgba(0, 0, 0, .75) 0 2px 6px;
}

#rectangletool {
    background: #358128; 
    color     : #f3f3f3;
    width     : 80px;
    height    : 25px;
    border    : 1px solid #33842a;
    -webkit-border-radius: 0 15px 15px 0;
    -moz-border-radius: 0 15px 15px 0;
    box-shadow: rgba(0, 0, 0, .75) 0 2px 6px;
}

#circletool {
    background: #358128; 
    color     : #f3f3f3;
    width     : 80px;
    height    : 25px;
    border    : 1px solid #33842a;
    -webkit-border-radius: 0 15px 15px 0;
    -moz-border-radius: 0 15px 15px 0;
    box-shadow: rgba(0, 0, 0, .75) 0 2px 6px;
}

#erasertool {
    background: #358128; 
    color     : #f3f3f3;
    width     : 80px;
    height    : 25px;
    border    : 1px solid #33842a;
    -webkit-border-radius: 0 15px 15px 0;
    -moz-border-radius: 0 15px 15px 0;
    box-shadow: rgba(0, 0, 0, .75) 0 2px 6px;
}

#resettool {
    background: #358128; 
    color     : #f3f3f3;
    width     : 80px;
    height    : 25px;
    border    : 1px solid #33842a;
    -webkit-border-radius: 0 15px 15px 0;
    -moz-border-radius: 0 15px 15px 0;
    box-shadow: rgba(0, 0, 0, .75) 0 2px 6px;
}                
<fieldset id="colorset" style="margin-top: 1.8%;">

        <table>
            <tr>
                <td><button style="height: 18px; width: 80px;" onclick="fill()">Fill</button>
                <td><button style="background-color: #000000; height: 15px; width: 15px;" onclick="color('#000000')"></button>
                <td><button style="background-color: #B0171F; height: 15px; width: 15px;" onclick="color('#B0171F')"></button>
                <td><button style="background-color: #DA70D6; height: 15px; width: 15px;" onclick="color('#DA70D6')"></button>
                <td><button style="background-color: #8A2BE2; height: 15px; width: 15px;" onclick="color('#8A2BE2')"></button>
                <td><button style="background-color: #0000FF; height: 15px; width: 15px;" onclick="color('#0000FF')"></button>
                <td><button style="background-color: #4876FF; height: 15px; width: 15px;" onclick="color('#4876FF')"></button>
                <td><button style="background-color: #CAE1FF; height: 15px; width: 15px;" onclick="color('#CAE1FF')"></button>
                <td><button style="background-color: #6E7B8B; height: 15px; width: 15px;" onclick="color('#6E7B8B')"></button>
                <td><button style="background-color: #00C78C; height: 15px; width: 15px;" onclick="color('#00C78C')"></button>
                <td><button style="background-color: #00FA9A; height: 15px; width: 15px;" onclick="color('#00FA9A')"></button>
                <td><button style="background-color: #00FF7F; height: 15px; width: 15px;" onclick="color('#00FF7F')"></button>
                <td><button style="background-color: #00C957; height: 15px; width: 15px;" onclick="color('#00C957')"></button>
                <td><button style="background-color: #FFFF00; height: 15px; width: 15px;" onclick="color('#FFFF00')"></button>
                <td><button style="background-color: #CDCD00; height: 15px; width: 15px;" onclick="color('#CDCD00')"></button>
                <td><button style="background-color: #FFF68F; height: 15px; width: 15px;" onclick="color('#FFF68F')"></button>
                <td><button style="background-color: #FFFACD; height: 15px; width: 15px;" onclick="color('#FFFACD')"></button>
                <td><button style="background-color: #FFEC8B; height: 15px; width: 15px;" onclick="color('#FFEC8B')"></button>
                <td><button style="background-color: #FFD700; height: 15px; width: 15px;" onclick="color('#FFD700')"></button>
                <td><button style="background-color: #F5DEB3; height: 15px; width: 15px;" onclick="color('#F5DEB3')"></button>
                <td><button style="background-color: #FFE4B5; height: 15px; width: 15px;" onclick="color('#FFE4B5')"></button>
                <td><button style="background-color: #EECFA1; height: 15px; width: 15px;" onclick="color('#EECFA1')"></button>
                <td><button style="background-color: #FF9912; height: 15px; width: 15px;" onclick="color('#FF9912')"></button>
                <td><button style="background-color: #8E388E; height: 15px; width: 15px;" onclick="color('#8E388E')"></button>
                <td><button style="background-color: #7171C6; height: 15px; width: 15px;" onclick="color('#7171C6')"></button>
                <td><button style="background-color: #7D9EC0; height: 15px; width: 15px;" onclick="color('#7D9EC0')"></button>
                <td><button style="background-color: #388E8E; height: 15px; width: 15px;" onclick="color('#388E8E')"></button>
                
            </tr>
            
            <tr>
                <td><button style="height: 18px; width: 80px" onclick="outline()">Outline</button>
                <td><button style="background-color: #71C671; height: 15px; width: 15px;" onclick="color('#71C671')"></button>
                <td><button style="background-color: #8E8E38; height: 15px; width: 15px;" onclick="color('#8E8E38')"></button>
                <td><button style="background-color: #C5C1AA; height: 15px; width: 15px;" onclick="color('#C5C1AA')"></button>
                <td><button style="background-color: #C67171; height: 15px; width: 15px;" onclick="color('#C67171')"></button>
                <td><button style="background-color: #555555; height: 15px; width: 15px;" onclick="color('#555555')"></button>
                <td><button style="background-color: #848484; height: 15px; width: 15px;" onclick="color('#848484')"></button>
                <td><button style="background-color: #F4F4F4; height: 15px; width: 15px;" onclick="color('#F4F4F4')"></button>
                <td><button style="background-color: #EE0000; height: 15px; width: 15px;" onclick="color('#EE0000')"></button>
                <td><button style="background-color: #FF4040; height: 15px; width: 15px;" onclick="color('#FF4040')"></button>
                <td><button style="background-color: #EE6363; height: 15px; width: 15px;" onclick="color('#EE6363')"></button>
                <td><button style="background-color: #FFC1C1; height: 15px; width: 15px;" onclick="color('#FFC1C1')"></button>
                <td><button style="background-color: #FF7256; height: 15px; width: 15px;" onclick="color('#FF7256')"></button>
                <td><button style="background-color: #FF4500; height: 15px; width: 15px;" onclick="color('#FF4500')"></button>
                <td><button style="background-color: #F4A460; height: 15px; width: 15px;" onclick="color('#F4A460')"></button>
                <td><button style="background-color: #FF8000; height: 15px; width: 15px;" onclick="color('FF8000')"></button>
                <td><button style="background-color: #FFD700; height: 15px; width: 15px;" onclick="color('#FFD700')"></button>
                <td><button style="background-color: #8B864E; height: 15px; width: 15px;" onclick="color('#8B864E')"></button>
                <td><button style="background-color: #9ACD32; height: 15px; width: 15px;" onclick="color('#9ACD32')"></button>
                <td><button style="background-color: #66CD00; height: 15px; width: 15px;" onclick="color('#66CD00')"></button>
                <td><button style="background-color: #BDFCC9; height: 15px; width: 15px;" onclick="color('#BDFCC9')"></button>
                <td><button style="background-color: #76EEC6; height: 15px; width: 15px;" onclick="color('#76EEC6')"></button>
                <td><button style="background-color: #40E0D0; height: 15px; width: 15px;" onclick="color('#40E0D0')"></button>
                <td><button style="background-color: #9B30FF; height: 15px; width: 15px;" onclick="color('#9B30FF')"></button>
                <td><button style="background-color: #EE82EE; height: 15px; width: 15px;" onclick="color('#EE82EE')"></button>
                <td><button style="background-color: #FFC0CB; height: 15px; width: 15px;" onclick="color('#FFC0CB')"></button>
                <td><button style="background-color: #7CFC00; height: 15px; width: 15px;" onclick="color('#7CFC00')"></button>
            </tr>
            <tr>
                <td><label>Line Width</label></td>
                <td><button id="pixel_plus" type="button" onclick="add_pixel()" style="width: 25px;">+</button></td>
                <td><button id="pixel_minus" type="button" onclick="reduce_pixel()" style="width: 25px;">-</button></td>
                <td><button id="undo" type="button" onclick="undo_pixel()"style="width: 75px;">Undo</button></td>

            </tr>
            </table>
            <br>
            <label>Tag</label><input id="fname" type="text"><button id="save" onclick="temp()">Add</button>
            <br>
            <br>
            </fieldset>

Update user information using react js and node js

I’d like to update the username and the email… the backend is working but the frontend is not updating,

I updated the username and the mail and when I see my update in the frontend, it’s the same nothing happend even though i got the alert “admin updated”, however when i test the backend there is no issue and it’s working .

the backend:

  app.put("/admin/:id", (req, res) => {
    LoginAdmin.findOneAndUpdate({_id: req.params.id},{
      $set:{
        email : req.body.email,
        adminname: req.body.adminname
      }
    }, function (err, data) {
      if (err){
        res.status(500).send(err)
    } else {
      res.status(200).send({message: 'UPDATED', data: data})
    }
    })
  })

the frontend:

const UpdateAdminAccount = (props) => {
    let navigate= useNavigate()
    const initialInputValues = {
      adminname: '',
      email: '',
    } 
    const [values, setValues] = useState(initialInputValues)

    //show admin info before updating
    const {id} = useParams()
    useEffect(()=>{
     if(id){
         getSingleAdmin(id)
     }
    },[id])
    const getSingleAdmin = async (id) =>{
        const response = await axios.get(`/admin/${id}`);
        console.log("response", response)
        if (response.status === 200){
            setValues(response.data);
        }
    };

      const handleInputChange = (e) => {
        const name = e.target.name
        const value = e.target.value
        setValues({
          ...values,
          [name]: value,
        })
      }   
 
      const updateAdmin = async (e, id) =>{
        e.preventDefault();
          await axios.put(`/admin/${id}`, {
          ...values
          }
          ).then((res) =>{    
            console.log(res)
              if (res.data.message === 'UPDATED') {
                  alert("admin updated")
                  }
            })   
    };
    return (
            <form method='Post'>
             <ul>
              <li>
                  <label>Name</label>
                  <input name="adminname" value={values.adminname} onChange={handleInputChange} type="text" />
              </li>
              <li> 
                  <label>Email</label>
                  <input name="email" value={values.email} onChange={handleInputChange} type="email"  />
             </li>
              <li>
              <li>
                   
                  <button className='submit-button' onClick={updateAdmin} type="submit" > 
                    Update
                  </button> :
                  
              </li>
             </ul>
            </form>
            </div>
  
        </div>  
      </div>
    );
}

export default UpdateAdminAccount;

vue3 setting css styles from vuex store

I am trying to update the value of my css property .page with the value from vuex store. I am able to do it via the value of data but not from the computed property.

    <script>
           export default {
            name: 'component',
            components: {
             

   Header,
            Footer
        },
        data(){
            return {
                color: '#f00'
            }
        },
    }
            
</script>
        
   <style>
        
        .page{
             background-color: v-bind(color);
        }
        
   </style>

above works, but below doesn’t.

<script>
   export default {
    name: 'component',
    components: {
        Header,
        Footer
    },
    branding() {
        return this.$store.state.branding.color;
        },
    }
            
 </script>
            
 <style>
            
     .page{
            background-color: v-bind(color);
     }
     

I’ve only got a basic understanding of vue so any help would be much appreciated

How to hide browser’s scrollbar when using locomotive-scroll in React?

I’ve been trying to use locomotive-scroll to add the smooth scrolling feature to my website. I got it up and running well, however while scrolling, I notice that the browser’s default scrollbar stays at the same place as the scrollbar from the locomotive-scroll. I tried to do everything to hide it but no success. Can anyone instruct me on this issue. Thank you. Here is the image of the scrollbar (the pink part is the locomotive’s scrollbar).

enter image description here

how to remove nav item on window resize?

I want target to prepent in more dropdown when screen size is below 1190px & remove target from dropdown when screen size is above 1190px

This is the outcome i want

I can make target disappear easily but target to appear in dropdown part is tricky. I’ve used window.onresize & window.onload with below condition

if (window.innerWidth < 1190 && window.innerWidth > 1188) { var dt = document.createElement("dt"); dt.innerHTML = 'Target'; dt.className = '.target' dl.prepend(dt); } if (window.innerWidth > 1189 && window.innerWidth < 1191) { console.log('done') dt?.remove() }