cancel
Showing results for 
Search instead for 
Did you mean: 

Java script for Adobe forms

Former Member
0 Kudos

Hello Everybody,

I want to write some client side javascript for Adobe forms.Like, i want to enable or disable some fields based upon some conditions or some events occured on the form. Events could be checking some check box or radio button or selecting value in combo box.

How can i capture such events and what code i need to write to change some field values in adobe form.

I am not aware of syntax for the same. So, if anybody had done this then please help me.

Regards,

Bhavik

Accepted Solutions (0)

Answers (3)

Answers (3)

Sarang_Akhare
Explorer
0 Kudos

Hi All,

In my case I have a drop down field having various values.According to those values the remaining fields in the form should get visible or invisible accordingly. Can you please help me out in scripting required in this case?

I have tried scripting as given below but it is not working. I request you to please tell me whats the problem in this and what needs to be done to achieve this.

For Example in case if i select "03 - Transfer" in the dropdown field named OPTION then I want to make New Personal Sub area field as visible and editable on the form so that user can enter data into it ELSE it should not be visible on the form.For this the scripting i wrote in javascript in the event CALCULATE for this field is as follows.

if($record.OPTION.DATA.FIELD == "03 - Transfer")

then

this.access == "open"

else

this.presence = "invisible"

endif

But this is not working when I check the form on portal.Please let me know what I need to do inorder to achieve this functionality.

Please provide me with information how to decide the event in which we should write the script?

Thanks in Advance.

Sarang

Edited by: sarang akhare on Oct 19, 2008 12:09 PM

Former Member
0 Kudos
Former Member
0 Kudos

Hi Nagarajan,

The links you have given gives the tutorials for offline scenarios and manipulation of pdf objects.

My requirement is different.

I need client side scripting for adobe forms. So, i can enable or disable some fields based on the checkboxes i clicked. Also i need to make some elements visible based on some conditions.

So, i want to know the javascripts for the same.

Regards,

Bhavik

markus_meisl
Active Contributor
0 Kudos

Hi Bhavik,

I think your request is too general for anyone to provide concrete JavaScript examples. While it is easy to understand what you want to do, you may have to give a very concrete example of what you want to do (e.g. I have a table with the following fields, and I want a button to be active when the value of this field is higher than 7, ...). I guess your chances of someone sharing their JavaScript knowledge will be better.

In the meantime, you may want to look at this document from the Adobe website http://partners.adobe.com/public/developer/en/xml/Adobe_XML_Form_Object_Model_Reference.pdf, which contains some scripting examples, and also call up the FormCalc Reference (from the Designer documentation) in case this scripting language could help you as well.

Regards,

Markus Meisl

SAP NetWeaver Product Management

Former Member
0 Kudos

Hi Markus,

Thanks for clarifying me.

I have one check box, on click of that check box i need to visible three input fields.

One more thing. I am using same tamplate for creating request as well as displying that request.So, when this pdf in display mode then all the fields should be read only.

How can i acomplish using scripting in adobe form. I guess i have to use scripting for this. There is no other option.

Regards,

Bhavik

Former Member
0 Kudos

Hi Bhavik,

To change the access mode of a field (read only/editable) you have to set the property "access".

In JavaScript:

TextField1.access = "readOnly";

TextField1.access = "open";

A field can be visible, invisible or hidden (takes no space on the form). To change the presence of a field you can set the "presence" property to one of the following values: visible, invisible or hidden.

In JavaScript:

TextField2.presence = "invisible";

TextField2.presence = "visible";

You have to use a dynamic PDF.

If you want to change serveral fields you can use a loop (i.e you can ask a subform for its children).

Regards

Juergen

Message was edited by: Juergen Hauser

Former Member
0 Kudos

Hello Everybody,

SAP experts please help me on this topic. I want to know what scripting is required for my functionalities in Adobe form?

I am waiting for useful suggestions.

Regards,

Bhavik