Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

Code to assign value of object

Avatar

Level 1

I'm new to LiveCycle, but have been looking at some of the examples.  I have entered the below code to assign the value of

an object on the second page of my form to equal "Name1" on page 1 of my form and I can't seem to get it to work.  What might I be doing wrong?

This is what I have.

if(form1.#PageSet[0].page1.name1 == Null) then $ = Null

elseif (HasValue(form1.#PageSet[0].page1.name1) ==1) then

$ = form1.#PageSet[0].page1.name1

else $ = " "

endif

1 Reply

Avatar

Level 10

If you are new to LiveCycle Designer I would recommend full-qualifying all forms objects, including pages and sub-forms. It simplifies understanding the hierarchical data model and finding fields in the model.

The attached contains two pages where each page has a sub-form called 'subform1' and two fields 'firstName' and 'lastName'.

The first script is on the exit event of 'form1.page1.subform1.firstName'. It demonstrates how to push the value entered to 'form1.page2.subform1.firstName' using JavaScript.

// form1.page1.subform1.firstName::exit - (JavaScript, client)

form1.page2.subform1.firstName.rawValue = form1.page1.subform1.firstName.rawValue;

The second script is on the calculate event of 'form1.page2.subform1.lastName'. It demonstrates how to capture the value entered in 'form1.page1.subform1.lastName' using FormCalc.

// form1.page2.subform1.lastName::calculate - (FormCalc, client)

$.rawValue = form1.page1.subform1.lastName.rawValue;

Steve