cancel
Showing results for 
Search instead for 
Did you mean: 

Scripting in Interactive Forms & Dropdown List

Former Member
0 Kudos

Hi,

I am quite new to Adobe Interactive forms and have some questions to scripting:

My form does contain some text fields and partner information as import parameter.

Now I want the following:

A)

1. If the partner id is given by the structure, the field partner id should be readonly

2. One text field Pers_Name should be the concatenation of name first and name last of the partner information

3. I want to show a message as I am not able to debug the scripts.

I tried both in the initialize and calculat event of the fields but nothing happens.

I tried also throwing a message, but nothing happens.

Here my scripts:

xfa.host.messageBox("Partnerfield " + $record.PERS_RESP.PARTNER);

if $record.PERS_RESP.PARTNER <> "" then

xfa.host.messageBox("Partnerfield readonly);

$record.PERS_RESP.PARTNER.access = "readOnly";

endif.

xfa.host.messageBox("Name " + $record.PERS_RESP.name_first + $record.PERS_RESP.name_last);

txtPers_Name.value = pers_resp-name_first + " " + pers_resp-name_last;

xfa.host.messageBox("Name complete = :" + txtPers_Name;

B) I have an import table with product information.

I need to have a table where the user is able to order products.

The given product table should be used as dropdown list in each product id field.

I binded the dropdown field to $record.PRODUCTS.DATA[*].PRODUCT_ID,

but now I have automatically several rows showing each entry in the product list, but nothing within the drop down list.

Thanks

Frank

Accepted Solutions (0)

Answers (1)

Answers (1)

chintan_virani
Active Contributor
0 Kudos

Frank,

You are using a mix of syntax for JavaScript and FormCalc. Formcalc statement do not end with ; and xfa.host.messageBox is method in JavaScript to get alert box. The FormCalc equivalent for it is $host.messageBox(".......")

Now coming to your questions.

1. Lets say you have Personal-Id field txtPersId . Select Javascript as Language and on initialize event of partner-id add following code:

xfa.host.messageBox("Partnerfield " + this.rawValue);
if (this.rawValue == "" | this.rawValue == null) 
{
   xfa.host.messageBox("Partnerfield is Readonly);
   txtPersId.access = "readOnly";
}

2. For dropdown goto Binding Tab. Click on Specify Item Values and in Items field enter as $record.sap-vhlist.PRODUCTS\.DATA\.FIELD.item[*]. Enter text in Item Text and key in Item Value field.

Refer the [Drop-Down Screenshot|http://img341.imageshack.us/my.php?image=dropdownpp2.png]

Hope this helps.

Chintan

Former Member
0 Kudos

Hi,

thanks for your help.

I changed the coding and data binding accordingly, but nothing changed.

There is no message coming up and the result in the table is still the same.

Perhaps it is because this form is used offlline?

Thx

Frank