Expand my Community achievements bar.

Guidelines for the Responsible Use of Generative AI in the Experience Cloud Community.
SOLVED

JavaScript function deletes previously entered data

Avatar

Level 1

Hello, I am using Adobe LiveCycle Designer version 9.0 and have created a one page form with a radio button list which allows a user to create an additional duplicate page when selected. All of the form was created as a master mage with the exception of the additional page radio button list that exists on "Page1." The script works great except all data entered by the user on Page1 is deleted when the additional page is created. Any suggestions would be greatly appreciated. I know just enough about JavaScript and FormCalc to paint myself into a corner (obviously) so speak slow and use small words please ...

Here is the code to add additional page:

topmostSubform.Page1.RadioButtonList::click - (JavaScript, client)

if (RadioButtonList.rawValue=="1")

{Page2.presence = "visible";}

else if (RadioButtonList.rawValue =="2")

{Page2.presence = "hidden";}

else

{Page2.presence = "hidden";}

1 Accepted Solution

Avatar

Correct answer by
Level 10

Hi,

You should see the binding properties on the binding tab of the object palette.  You can't upload your form directly to the forum anymore, you will have to upload it to acrobat.com, google docs, etc and post a link in this thread.

Bruce

View solution in original post

6 Replies

Avatar

Level 10

Hi,

I would guess there is a problem with the field bindings and that the fields on Page1 are bound to the same data values and those on Page2?

Bruce

Avatar

Level 1

Do you know how I would go about changing those settings? I would attach the form but I do not see any mechanism for doing so.

Avatar

Correct answer by
Level 10

Hi,

You should see the binding properties on the binding tab of the object palette.  You can't upload your form directly to the forum anymore, you will have to upload it to acrobat.com, google docs, etc and post a link in this thread.

Bruce

Avatar

Level 1

HI Bruce,

I uploaded a copy of the file to google docs if you dont mind taking a look. None of the settings that I can change on the binding tab appear to have the desired effect. I know that when I originally created the form I copied all of the data and pasted it into Page2. Now on the Hierarch tab to the left it lists the contents of Page2 as "referenced objects." Is there a way to change this or do I need to delete the page and start page 2 from scratch? Thanks! Link is below.

https://drive.google.com/file/d/0B6LRMwTorkrDWGZvWTA5amE5ajA/edit?usp=sharing

Message was edited by: MikeMIkeMike

Avatar

Level 2

I see two things that are problematic:

  1. In general, you should try to avoid putting fields on a master page...you can sometimes experience unexpected results when you do.  Move your table to the body page instead and your problem will go away.
  2. All of your fields are set with binding of "No data binding" (Object-->Binding-->Data Binding).  As a result, if you save your form, close and re-open it, the data will likely be lost.  At a minimum you should set the data binding to "Use Name".

Some other recommendations:

  1. Try to avoid using so many rectangles...they are unneccessary, and the the number of objects used on your form can impact performance.  Use borders around text fields or text objects instead.
  2. You should have a single table rather than two separate tables on two separate pages.  If you add a second page, then the totals at the bottom of each page will only reflect the totals for that page.  Create a dynamic table and allow people to add new rows rather than adding an entire page.  The use of a flowed layout and a content area on the master page will prevent the data from flowing into the footer and will force the creation of a new page as needed.
  3. You have a bunch of scripts on your dropdowns that try to connect to a database connection that doesn't appear to exist.  Remove these if they aren't needed.
  4. Because the Approving Official field is on the master page, it will appear at the bottom of every page.  Do you want it at the bottom of every page, or just at the bottom of the last page?  If the bottom of the last page, then add it to the body page in a flowed layout, or create two separate master pages.
  5. Week Ending appears at the top of every page, but you have to enter a value on every page.  Set the data binding to "Use global data" and it will ensure that the values on each page are kept in synch.

Avatar

Level 1

Justin, Thank you so much! This has made a huge improvement on the form. Other than minor tweaks I am now ready to publish Thanks again Justin and Bruce for all the help!