These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

Script syntax

patra
Registered: Oct 19 2006
Posts: 270
Answered

I have a subformA with presence set to Hidden. I control the presence of the subformA from another button.
This which I like to accomlish is when the subformA is visible with Doc Ready event to alert the user with a message!
I try this but does not work properly:

if (form1.subformA.presence =="visible");
{
app.alert("Please check ......!\n\nThank You!",3);
}

Thanks

My Product Information:
LiveCycle Designer, Windows
radzmar
Expert
Registered: Nov 3 2008
Posts: 1202
You should use this script in the layout:ready event of the subform, because hiding/showing subforms affects the form layout.
I removed the semicolon after the if expression, because it is no part of the syntax.

if (this.presence == "visible"){app.alert("Please check ......!\n\nThank You!",3);}else{}

radzmar
LoveCycle Blog
Documents you need:
LiveCycle Designer ES2 Docs

patra
Registered: Oct 19 2006
Posts: 270
Thank Radzmar for your help!

One more question:
Is it possible into alert message to include the value of a Text Field?
Like:
app.alert("Please check +TextField.Value +......!\n\nThank You!",3);

Thank
radzmar
Expert
Registered: Nov 3 2008
Posts: 1202
You bet!
Could look like this.

var AddMessage = Textfield1.rawValue;xfa.host.messageBox("Please check " + AddMessage + "....! \r\r Thank You!");

radzmar
LoveCycle Blog
Documents you need:
LiveCycle Designer ES2 Docs

patra
Registered: Oct 19 2006
Posts: 270
This is my script on Layout_Ready but does not work

if (this.presence == "visible")
{
var AddMessage = ID.rawValue;

app.alert("Your Photocopier Password is:" + AddMessage + "....! is Please check the Printing Section for more Info!\n\nThank You!",3);
}
else
{}