Skip to Content

If Condition In Java Script

Hello All,

I have a requirement too display two different contents depending on the copies.

e.g : In case of bank copy we need to display content A.

        In case of Client copy we need to display Content B.

When i have written the If statement in this particular case to find out the copy in Java Script.

The Condition is failing and now working.

Can you please let me know the syntax and how do we actually compare the conditions in the Java Script.

Rgds,

V

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Oct 26, 2012 at 07:43 AM

    Hi Varun,

    The syntax of if condition java script is quiet simple

    But as far as I understood your problem you need to print two different copies .

    First of all you need to pass a variable from the interface to the context of form in layout

    Make this field as hidden from the properties

    Next thing is to write a java script on the hidden text field

    if ( this.rawValue == Value )

    {

    a.presence = "visible";

    b.presence = "visible";

    c.presence = "invisible";

    }

    else

    {

    a.presence = "invisible";

    b.presence = "invisible";

    c.presence = "visible";

    }

    endif.

    Hope this helps

    Rgds,

    Sandeep katoch

    Add comment
    10|10000 characters needed characters exceeded