Skip to Content
avatar image
Former Member

Adobe Form - if condition

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

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • avatar image
    Former Member
    Jan 17, 2013 at 10:25 AM

    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

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      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.