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

Multiple Options in a Pop Up needed to have answer go to textfield

Profy
Registered: Jul 15 2010
Posts: 19

I found this script on the web. It works for having multiple options in a pop up.
 
I would like to have the options I pick to populate a textfield. I have tried everything I know, If any body can help that would be great.
 
Thanks
  
form1.#subform[0].Button11::click - (JavaScript, client)
 
var FormRouting =
{
 
result:"cancel",
DoDialog: function(){return app.execDialog(this);},
bChk2:false,
bChk3:false,
bChk4:false,
bChk5:false,
initialize: function(dialog)
{
var dlgInit =
{
"Chk2": this.bChk2,
"Chk3": this.bChk3,
"Chk4": this.bChk4,
"Chk5": this.bChk5,
};
dialog.load(dlgInit);
},
commit: function(dialog)
{
var oRslt = dialog.store();
this.bChk2 = oRslt["Chk2"];
this.bChk3 = oRslt["Chk3"];
this.bChk4 = oRslt["Chk4"];
this.bChk5 = oRslt["Chk5"];
},
description:
{
name: "Form Routing",
elements:
[
{
type: "view",
elements:
[
{
type: "view",
char_height: 10,
elements:
[
{
type: "static_text",
item_id: "stat",
name: "Technicians:",
char_width: 15,
alignment: "align_fill",
font: "dialog",
},
{
type: "view",
char_width: 8,
char_height: 8,
align_children: "align_top",
elements:
[
{
type: "view",
char_width: 8,
char_height: 8,
elements:
[
{
type: "check_box",
item_id: "Chk2",
name: "Chad",
},
{
type: "check_box",
item_id: "Chk3",
name: "Darryl",
},
{
type: "check_box",
item_id: "Chk4",
name: "Doug",
},
 
]
},
{
type: "view",
char_width: 8,
char_height: 8,
elements:
[
{
type: "check_box",
item_id: "Chk5",
name: "Kurtis",
},
{
type: "check_box",
item_id: "Chk5",
name: "Mike",
},
{
type: "check_box",
item_id: "Chk5",
name: "Other",
},
]
},
]
},
]
},
{
type: "ok_cancel",
},
]
},
]
}
};
 
// Example Code
FormRouting.bChk2 = false;
FormRouting.bChk3 = false;
FormRouting.bChk4 = false;
FormRouting.bChk5 = false;
if("ok" == FormRouting.DoDialog())
{
console.println("Chk2:" + FormRouting.bChk2);
console.println("Chk3:" + FormRouting.bChk3);
console.println("Chk4:" + FormRouting.bChk4);
console.println("Chk5:" + FormRouting.bChk5);
 
}

My Product Information:
LiveCycle Designer, Windows
DaveyB
Registered: Dec 10 2010
Posts: 70
Create your popup as a function call, rather than as an event on a button. Set the return from the function to provide the formatted text you need, and set the button to call the TextFieldValue = YourFunctionName() thereby returning the value of the function (after processing) into the desired text field.

Hope that helps!

DaveyB

LiveCycle Designer 8.0
"Genius is one percent inspiration, ninety-nine percent perspiration." ~~ Thomas Edison
"If at first you don't succeed, get a bigger hammer." ~~ Alan Lewis
"If the conventional doesn't work, try the unconventional" ~~ DaveyB

Profy
Registered: Jul 15 2010
Posts: 19
DaveyB,

Thank You for the answer but I am still a little new with using the function options.

I figured out how to make the function part work, but I cannot get the names I choose go to the textfield, also I can only have the function run once when I click on the button.

Is there something I need to change in the main script of the function to get the names to populate the textfield?

If you can help with writing out the script that would help me out a lot.