cancel
Showing results for 
Search instead for 
Did you mean: 

Adobe Form - if condition

Former Member
0 Kudos

Hi,

I am struggling to write the correct if condition and require help to write the java script code . I am on Page 2 and want to display or hide the page based on a simple if condition. I have used the interface code initialization to create a global variable "page_flag" with values "S" and "M" based on a business logic. I have declared the page_flag varibale in the global parameters.

In the adobe form I wrote the below condition under client, Javascript and intiliaze position

------------------------------------------------------------------

data.Page2::initialize - (JavaScript, client)

if

(PAGE_FLAG.rawValue = "M")

{
  Page2.presence = "visible"

}

else

{
  Page2.presence = "hidden"

}

I am not sure if the global variable PAGE_FLAG can be referenced here in the java script code and if false I am un sure if the code in red above is correct.

Regards

Praneeth

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi All,

I have a real problem now . 🙂 I am struggling with thiss logic now. I used the below javascript but still I do not see the problem rectified.

I have placed the below code in the PAGE1 -> Table initialization java script 

if

(this.PAGE_FLAG.rawValue == "M" )
{

     this.presence = "hidden";

}

If I take out the if condition and leave the below code I can hide the table as I wanted.

this.presence = "hidden";

so I think the problem is with the if condition.. PAGE_FLAG is a a global variable declared in the interface and I have populated this variable in the code initilization part.

Regards

Praneeth

Former Member
0 Kudos

Hi Praneeth,

Where is your page_flag variable? If its not in your form and its just there in DATA VIEW, then you have to place it somewhere on that page layout, so that you can navigate to it and use it in java script. You can hide that field using presence method if you don't need that.

If still not solved please provide the hierarchy view of your form.

Regards,

Mahidhar.