Here is a simple PHP form with a button.. Here is the Jquery functions which executes a PHP file. And the test.php is as follows, My question is how to modify my test.php if I have multiple buttons. As an example, Result should be, Update: What If I need to run three different php functions(no any pattern)? A…
Tag: javascript
I am trying to use the react hook useContext() but its not working
i am trying to use the useContext hook for the first time and i am not getting the name displayed on screen, i have never used useContext ever before, so pls a little bit of explination of my mistake will be appreciated. Here is the code: (edit: added App.js) AuthContext.js Header.js App.js i have added the e…
How can I extract from an array of arrays all the arrays that have the same value in their first field?
The following function elegantly finds duplicates in 1-dimensional arrays: When I send it (for example) this array [‘123456’, ‘787877’, ‘763223’, ‘787877’, ‘854544’] it returns [‘787877’]. What I need is something similar that works for a…
Exporting a boolean variable that depends on an if statement (React JS & Firebase)?
I’m trying to declare a boolean from my firebase.js configuration file that depends on an if-else statement that checks whether a user is logged in or not. I want to store the log in status of a user in a boolean variable and export that variable across different components in my React app. So if user i…
“TypeError: Cannot read properties of undefined (reading ‘hasOwnProperty’)” error
EDIT: PROBLEM SOLVED. I’m trying to make an update profile page for an Express app with Mongoose, and I got the error “TypeError: Cannot read properties of undefined (reading ‘hasOwnProperty’)”. I am confused how to fix it. Here is my code, thanks (error shown) [1]: https://i.sta…
Add field to CosmosDB item with Javascript SDK Error: Entity with the specified id does not exist in the system
I am trying to add a new field to a CosmosDB item. The Field i want to add is an object. For example: I tried the following code: I get the error: Entity with the specified id does not exist in the system The item exists because i get the item when using container.item(“42”).read() Answer The valu…
Check and Uncheck Parent/Child Checkboxes using Jquery
I have to use group of checkboxes in my project. This is how my HTML look like: Using this checkboxes, users can select their preferred parent and sub module selection. When making that selection, it should work as follows. When a parent is checked, all children are checked under it. (Parents and children are…
SyntaxError: /home/container/config.json: Unexpected token } in JSON at position 2769
Im getting this SyntaxError: /home/container/config.json: Unexpected token } in JSON at position 2769 error, here’s my config.json Can someone please help me fix this I am pretty sure I am supposed to add a : but i dont know how to fix this syntax error I dont understand what is wrong, using node v16 An…
Can’t get the JS script to output data on HTML page
My code below is a simple form which takes an integer, and a yes/no radio button pair. If ‘yes’ is selected (the left option) then the value you entered * 0.13 should be displayed – if ‘no’ is selected (or neither are selected) then the value 0 should be displayed. It is not work…
JavaScript get cookies function
I’ve been learning on how to get Cookies from a web page. Below is the code extracted from w3schools.com. I am not sure why they used this line of code in the getCookies(cname) function as shown below. Why should there be a blank space at the start of every string in the array “ca”? And why …