Hiding a Field Using Javascript in Adobe Form Based on the Condition

12
Hiding a Field Using Javascript in Adobe Form based on the condition By Kalyan Balabhadrapatruni, YASH Technologies Go to Transaction SFP-> Select Interface Radio Button & Enter the name to create New Interface. (Eg:- zhide_field). Click on Create & Enter the Description and Press Save:

description

Hiding fields using javascript Adobe forms

Transcript of Hiding a Field Using Javascript in Adobe Form Based on the Condition

Page 1: Hiding a Field Using Javascript in Adobe Form Based on the Condition

Hiding a Field Using Javascript in Adobe Form based on

the condition

By Kalyan Balabhadrapatruni, YASH Technologies

Go to Transaction SFP->

Select Interface Radio Button & Enter the name to create New Interface.

(Eg:- zhide_field).

Click on Create & Enter the Description and Press Save:

Page 2: Hiding a Field Using Javascript in Adobe Form Based on the Condition

Press Save Button.

Creating a import parameter

Go to Form Interface->import ->Parameters name -> Enter the import parameter (ie:- pernr)

Creating the Global Delivery which will passed filled in the form interface and passed to the Layout of adobe form.

Go to Global Definitions->Global Data -> enter the below variables.

Page 3: Hiding a Field Using Javascript in Adobe Form Based on the Condition

Go to Global Definitions->Create types.

Go to Initialization->code Initialization.

Enter the below code.

Page 4: Hiding a Field Using Javascript in Adobe Form Based on the Condition

Save

Check

Activate the Interface.

Click here to continue...

Once the interface is activated.

Page 5: Hiding a Field Using Javascript in Adobe Form Based on the Condition

Go back to transaction SFP.

Select Form Radio Button & Enter the name to create New Form.

(Eg:- zhide_field).

Enter the Description & Interface name which we have created and press save button.

Press save.

Page 6: Hiding a Field Using Javascript in Adobe Form Based on the Condition

Form Context is displayed as below.

Drag & drop the Global data form Interface to Context Level & Save the form.

Page 7: Hiding a Field Using Javascript in Adobe Form Based on the Condition

Click on the Layout to design the layout.

Form layout is displayed.

Click on the data view to View the fields that are add to the context in the context tab.

Page 8: Hiding a Field Using Javascript in Adobe Form Based on the Condition

Click here to continue...

Now drag and drop the fields from the Data view to the form.

Page 9: Hiding a Field Using Javascript in Adobe Form Based on the Condition

Select object name ->go to Palettes->Click on Script Editor.

This script will hide the field in runtime if it is initial.

Enter the below JavaScript in the editor & Select the language as JavaScript.

if(this.rawValue == null)

Page 10: Hiding a Field Using Javascript in Adobe Form Based on the Condition

{

this.presence = "hidden";

}

Save and activate the form.

Execute the form to see the below screen.

Here for output we will have two scenarios.

SCENARIO 1: Position Title is not initial

SCENARIO 2: Position Title is initial

Page 11: Hiding a Field Using Javascript in Adobe Form Based on the Condition

SCENARIO 2:

Page 12: Hiding a Field Using Javascript in Adobe Form Based on the Condition