Expand my Community achievements bar.

Saved State - how to keep removed items from reappearing when PDF is reopened?

Avatar

Level 2


Hi everyone,

I have a form that lets you removed questions (tables). However if a user removes them, saves the PDF and then repoens it later, the removed questions are back. Anything that is typed will be saved, but the tables keep coming back. Here is a short video that shows what happens.

IMG_3441.mp4 - Google Drive

I searched the forum and found some posts that I think are similar but I can't get a solution to work. One invloved copying the script that deletes the table (code resides in the the click event) to the form:ready event. Here is the code from the click event that deletes the table:

form1.SectionESBusinessAcumen.QuestionsContainer.SFBusinessAcumenQuestions.S1Q1Table.Row1.SubformS1Q1Remove.S1Q1Remove::click - (JavaScript, client)
var cMsg = "Are you sure you want to delete this question?";

var nRtn = app.alert(cMsg,2,2,"Question Alert Box");
if(nRtn == 4)
{// A yes Response
  // Code for doing the thing you do on a yes
  console.println("The Response Was Yes");
  // Code that removes the question
  S1Q1Table._Row1.removeInstance(0);
}
else if(nRtn == 3)
{ // No Response
  console.println("The Response Was No");
}
else  
{ //Unknown Response
  console.println("The Response Was somthing other than Yes/No: " + nRtn);
}

Here is a screenshot of what the table looks like with the structure:

table_detail.png

Thank you very much for any help or information you can provide.

Chris

0 Replies