How to change the state of the inputa to disabled and save the entered data?


Warning: count(): Parameter must be an array or an object that implements Countable in /home/styllloz/public_html/qa-theme/donut-theme/qa-donut-layer.php on line 274
0 like 0 dislike
30 views
Hello!

There are this kind of shape.

You must implement the changes and save the data in the input"E.
In the initial state inactive and there is only the "change" button, clicking on it you can enter data into the form and instead of "edit" button "save".

Individually, all the functions are found and implemented, but how to reconcile this, I can't understand( Just starting to learn javascript.

Pardon the arrogance, but do not have time to understand. Not knowing javascript, I can't even correct layout to create.

Thank you in advance for your help!
by | 30 views

2 Answers

0 like 0 dislike
I'm too lazy to write other code, but:

If there is no data for the fields - all fields are active, empty if the data is (for example You store them in localStorage) fill in the fields and put them into disable.

By clicking on the "Edit" shoot to disable, when you click on the "Save" update the data from the form into the vault and put the disable fields. Everything is logical and simple.

About local storage - https://developer.mozilla.org/ru/docs/Web/API/Wind...
How to change the attributes of the elements https://learn.javascript.ru/attributes-and-custom-...
How to iterate the elements https://learn.javascript.ru/searching-elements-dom
by
0 like 0 dislike
by

Related questions

0 like 0 dislike
1 answer
0 like 0 dislike
1 answer
asked Jun 1, 2019 by I3EKTOP
0 like 0 dislike
1 answer
0 like 0 dislike
1 answer
asked Apr 9, 2019 by Aram1
110,608 questions
257,186 answers
0 comments
35,574 users