Home > front end >  JS, how input saving be implemented when I have multiple input fields?
JS, how input saving be implemented when I have multiple input fields?

Time:02-10

As you can see, I have a form with many dishes ( dishes are loaded from DB and the quantity may vary ).

My code, Click here

I wrote a simple JS that changes input when button is clicked., but I have 2 problems:

  1. User reloads the page to sort dishes ( I can't do anything about it ) and input just disappears. I there any way to save the input near multiple dishes, for example, in localStorage and clear it when the form is submitted.

  2. Is there any way to count the price of an order ( price * value ) so that user can see it before confirming.

My JS knowledge are too poor for this task, but it's crucial for me to pass my backend test for a job and I have literally hours left.

CodePudding user response:

  •  Tags:  
  • Related