7
I have a table that, depending on the amount of an X value, inserts a set of attributes at the bottom of the page (fields). These elements have events assigned to them. But that’s not the point.
Problem is: how do I add the elements after the DOM is loaded (the moment I fill the value of X), when I close the "Back" button, after any operation, and return to the same screen, the values included in these added fields later do not have their values reloaded and not even the fields themselves.
EDIT
Setting:
I have a form that generates additional fields, based on other fields already present. These fields vary in size, so I can’t include them with "display:None" and simply show them later.
Then my user fills in the form, generates the additional fields and presses the "Save" button, but the form does not pass validation.
In this case I could (should) redirect the user to the previous screen.
Then the problem arises: As the additional fields were generated after the DOM was loaded and rendered, they do not appear when the user returns to the screen, because the browser takes this information from the DOM*.
I imagine there must be another way to do that I said, but that was just to give you an example. I really need to include in the DOM elements added later.
Does anyone know if it is possible to add these elements to the DOM even after it is loaded?
*This information that he carries from DOM I got from sources "unreliable", by comments on a blog.
Just to better understand your problem. You need the values to persist in the table?
– Luiz Picolo
That’s it! When I leave the page and come back, would you like them to still be (return to) there.
– Dennis Braga
Your question was not very clear. I had the same doubt as @Luizpicolo, you could edit it at this point.
– gvsrepins
I also couldn’t figure out exactly what your problem is.
– Daniel T. Sobrosa
I edited the question, it may help to better understand the problem.
– Dennis Braga