buckeyeleaf1979
Programmer
hello, new member here. kinda new to javascript but not to coding.
so I wrote a page in mainly php with a few javascript components. Right now in the body of the page i a looping output from the database and match it against an array. each row has a button that toggles from "add record" to a green button depending if the record is a match from the array.
When the page is loaded it stores into an array of records from the database. if there is a match, it will show the green button. When you hit the add button, it calls a function in the head and adds the record then displays a popup that it was added.
The question i have is, how can i add the new record to the array then have the button in the body change instantly?
so I wrote a page in mainly php with a few javascript components. Right now in the body of the page i a looping output from the database and match it against an array. each row has a button that toggles from "add record" to a green button depending if the record is a match from the array.
When the page is loaded it stores into an array of records from the database. if there is a match, it will show the green button. When you hit the add button, it calls a function in the head and adds the record then displays a popup that it was added.
The question i have is, how can i add the new record to the array then have the button in the body change instantly?