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
BedrockMission!

Learn more

View all

Sign in to view all badges

Notify user when a second page is generated

gwynp51907864
Level 2
Level 2

Hi all,

I have a form with three tables. Users are able to make these tables appear and disappear on a click event. They are also able to add rows to these tables again on a click event.

Because of the two possibilities below, this form will at times spread to a second page.

The overseer of our forms development project would like to be able to notify the user when the page expands on to the second page.

Can anyone tell me how to generate a message box only in the event that a second page is generated?

Please keep in mind that I'm a newbie to both Livecycle and JavaScript.

Thanks in advance!

4 Replies
Anonymous
Not applicable

gwynp51907864
Level 2
Level 2

Thanks,

It did work, but for some reason it's firing twice? i.e. the message box appears twice when it should only appear once

I think it must be something to do with where I have the code? Below is where I have it.

form1.#pageSet[0].Page1.#subform[0]::calculate - (JavaScript, client)

Also, once it's fired it keeps firing with every button that is pressed.

In reality the form would only ever be a maximum of 2 pages but when I change the code to if(pCount = 2) the code fires as soon as the form opens and on every click after that.

Is there some tweaking that we can do with it?

Thanks for your help!

Much appreciated

christopherf635
Level 1
Level 1

Hey, gwynp51907864,

You could use a global variable like boolMessageFired set to 0.  Check the value before entering the calculate event, if it is 0, enter the event then set it to 1 before exiting the event.  If it is 1, write code to exit the event so the code won't execute.  The next time you enter the event, the code should be bypassed and the message box will be suppressed. 

gwynp51907864
Level 2
Level 2

Hi @christopherf63509669,

Thanks for your suggestion. I guess what I should have included in my first post is that I'm a novice at JavaScript. Could you explain how to use your suggestions, even if it's a snippet of code, so that I can try and adapt it for what I require?

Thanks