Skip to content
Advertisement

Add information in contenteditable and generate stuff without loosing added infos

So I’ve created a list of radios where you can choose between 3 choices (cf. snippet) and then generate a report in a contenteditable area with the value of each radio.

It works fine, but I would like to be able to write text between the items and when you press again the button, only the items change but the added text stays. For the moment, when I generate the report, it deletes the added text (and it’s normal because I change the string with id=”itemXX” when I add text, but I can’t find a way to make it work :/ ).

The ideal would be that each item could be changed individually and the added text stays.

Thanks for the help 🙂

JavaScript
JavaScript
JavaScript

Advertisement

Answer

You can just move the editable part of the report to the line after the “form input lines”. I highlighted them with a gray background. Now, the user an only edit these two lines.

JavaScript
JavaScript
JavaScript
User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement