I’m looking for a way to check if a discord users name contains numbers and certain letter, and if it does then apply a calculation to it. For example I have a command that right now checks if the user has anything in the nickname, this adds the additional number next to the previous one (if there is on…
Tag: javascript
Express get request with an :id-parameter being run twice
I have an API made with node and express, and the end goal is to store the :id-parameter from the request in a variable so that I can query a specific table from my SQLite database with a specific id. Now the get request with an :id-parameter is being run twice, once with the request url being what it´s suppo…
2 Newline Characters if There is an Empty Line in Textarea
I’m trying to get the number of lines that a textarea has for a line counter (for a text editor), but if there is an emtpy line in the textarea, there are two new lines added. Here is the output: My code: At someone’s request, here is the HTML: Basically I plan on adding syntax highlighting, so th…
Display different html content dependant on JVectormap region in shadowbox.js
Ive created a world map using JVectorMap and am wanting to open a box using Shadowbox.js displaying various information about each highlighted country – In this example it’s specifically MENA countries. I need help with displaying a different message depending on which of the highlighted countries…
How do I find an exact substring match in an array in JavaScript?
I’m having trouble trying to find a substring within a string. This isn’t a simple substring match using indexOf or match() or test() or includes(). I’ve tried using these but to no avail. I have a bunch of strings inside an array, and then either need to use filter() method or the some() me…
Why does my array from backend doesn’t print in the frontend ReactJS?
I have a simple ‘Submit a post’ project with 2 inputs (title and description) and a submit button. Whenever I press submit, I send the title and description value to the backend where it it stored there in an array called submittedPosts. For example: Code in the backend: The problem is – I c…
How can I replace boolean values in a table, imported from a MYSQL database, with a custom string?
I have a php script for an admin panel that shows if a device is broken or not. But it (of course) only displays 1’s and 0’s. I want to make it more user friendly by replacing a 0 with “broken” and a 1 with “working”. I didn’t try anything yet because I don’t go…
array.every() works on only first element
I have an array I need a function call to be looped on every element of array, but somehow after executing function for first element ‘shippingError’, the loop stops. Below is the function call And the function that is executed It sometimes, works on array element, but mostly stops after first ele…
HighCharts – Can’t scroll page when cursor is on column chart
I’m using highcharts-react-official version 3.0.0 and highcharts version 8.1.2 in my web application. My problem is that the user can’t scroll the page, using the mouse wheel, when the mouse cursor is positioned on a column chart. My page is full of charts, so in order to scroll, the user has to b…
how to get data from dynamically created input fields react
I’m trying to capture the inputs of dynamically created input fields and I’m only able to get the first set of exercise fields(Exercise, Reps, Sets) Whenever I type in one of the added exercise fields it will just remove it after the first character. I also tried to add an if statement in the hand…