Restore deleted entries

Hello dear Plumsail support team,

I am currently trying to delete values as soon as you click on the respective "Delete" button. The whole thing works fine. But now, if the button was pressed by mistake, when pressing it again ("false"), the value should be displayed that was there before pressing it.
As an example, if Teststreet was there before and the button is clicked, Teststreet should disappear and as soon as the button is clicked again, it should be displayed again.
Is this possible? Here is my code.

var Delete = ['Toggle1','Toggle2', 'Toggle3','Toggle4', 'Toggle5', 'Toggle6', 'Toggle7', 'Toggle8'];
var DeletenewData = ['Street_x0020_change', 'House_x0020_number_x0020_change', 'Postal_x0020_code_x0020_change', 'Postal_x0020_code_x0020__x0028_P0', 'PO_x0020_box_x0020_change', 'E_x002d_mail_x0020_change', 'IBAN_x0020_change', 'IBAN_x0020_change_x0020_2'];
for (var i = 0; i < Delete.length; i++) {
    fd.field(Delete[i]).$on('change', DeleteData);

function DeleteData() {
var test;
var i = 0
    for (i; i < Delete.length; i++) {
        if (fd.field(Delete[i]).value) {
            test= fd.field(DeletenewData[i]).value;
            fd.field(DeletenewData[i]).value = '';
        }else {
            fd.field(DeletenewData[i]).value = test;

Hello @Sternchen,

For instance, you can save field value to local storage like so:

    localStorage.setItem('Title', fd.field('Title').value);
else {
        fd.field('Title').value = localStorage.getItem('Title');