cancel
Showing results for 
Search instead for 
Did you mean: 

If Condition In Java Script

varun_vadnala3
Active Participant
0 Kudos

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

Accepted Solutions (0)

Answers (1)

Answers (1)

sandeep_katoch
Contributor
0 Kudos

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