I am a little confused on how I go about taking the initial amount and displaying it in the “Balance” box I created. Then how to keep referring to the newly created ‘amount’ fields since they will have their own data-* ids created for localStorage.
I am really looking for someone to perhaps point me in the right direction because googling has done little to help me thus far so any insight you can offer will be greatly appreciated.
Hi Eric! It might be hard to help much without seeing what you are working with now. It might be a little much to try and put everything up in the forum, so maybe if you have specific questions, or we can go through things one at a time until we get everything working? What specifically are you stuck on right now?
you can get hold of the amount entered through the value attribute of the form element and then set the value to the required field.
You can use querySelectors along with getAttribute function to fill in the balance field automatically.
You probability need a state for each part and a way to display while calculating.
If react :
This might help Dealing With State in React | kirupa.com