Expand my Community achievements bar.

July 31st AEM Gems Webinar: Elevate your AEM development to master the integration of private GitHub repositories within AEM Cloud Manager.

If... Else issues

Avatar

Level 2

Doesn't get an y easier then this i bet.

I have a book on the way for working with ES but for now i need help.

Two Questions:

1: I have ES (whatever ES2 is I don't know, must be some $1,000 upgrade)

     Is ES2 part of Acrobat 9 Pro?

     I have ES Ver. 8.2

Anyhow,

2: here is the code:

I have a checkbox to detemine what form is being sent. Checked shows and/or hides fields and subforms accordingly.

if

(chkconfirmation.rawValue == 1) then

transfax.presence

="visible";

//other sections, fields etc.

else

transfax.presence

="hidden";

//other sections, fields etc.

endif

Nothing is working.

I am sure its a matter of lack of knowledge.

I am not getting any errors but it won't work.

Someone please get me in the right direction?

Thanks in advance

Chris

8 Replies

Avatar

Former Community Member

Q1. ES2 is part of the Server based install .....for your purposes version 8.2 of Designer that ship

s with Acrobat 9 is the same thing.

Q2. What event did you tie your code to? Did you choose FormCalc or Javascript as your language?

Paul

Avatar

Level 2

I have it in the click event of the checkbox using formcalc

When should i use formcalc or javascript?

FYI - down the road ppl will have this form on their pc and a database on a server.

but for now I just need to get this current matter resolved first though.

thanks

Avatar

Former Community Member

Did you save the form as dynamic? The presence will not change unless the form is dynamic. You can add message

boxes to ensure that your code is executing the way you want. for example:

xfa.host.messageBox("Start of script")

if (checkbox.rawValue == 1) then

     xfa.host.messageBox("The checkbox is on")

     field.presence = 'invisible"

else

     xfa.host.messageBox("The checkbox is off")

     field.presence = "visible"

endif

Hope that helps

Paul

Avatar

Level 2

The script is running correctly using your code with the message boxes.

I have been trying to 'test' the form in the Preview tab of LCES.

Will that allow me to test out the form VS having to save it as a Dynamic PDF after each modification?

I guess not, because the presence is not changing!

Avatar

Former Community Member

No do a File/SaveAS and pick the option to save it as a dynamic PDF. Then try it again and it should work. If in doubt you can right mouse click on the Preview tab and it will indicate which type it is saved as.

Paul

Avatar

Level 2

NOTE: I just went into Form Properties/Preview tab and changed the

Preview XML Adobe Form As: to Dynamic.

It worked in the LCES preview tab.

Do you think this is equal to doing a Save As.. Dynamic form

Avatar

Former Community Member

It is for the Preview but when you save you must explicitly choose the Dynamic PDF option ....otherwise it wil be static.

Paul

Avatar

Level 2

Thank you very much. Very helpful.