Expand my Community achievements bar.

Applications for the 2024-2025 Adobe Experience Manager Champion Program are open!

How to hide the Imagefield using java script?

Avatar

Level 1

i am  trying to hide the image  field  using java scipt?

i  written this  code in calculate* event and  it's not working in my adobe live cycle designer..?

Could you please clarify this  issue?

var x= this.rawValue;

x = 100;

if(x >= 0 && x <=10000)

{

ImageField1.presence = "visible";

ImageField2.presence = "hidden";

} else

if(x >= 10001 && x <= 100000)

{

ImageField1.presence = "hidden";

}

5 Replies

Avatar

Level 3

Try the forum for LiveCycle Designer.

Avatar

Level 1

Yes I tried on Form  live cycle designer

Avatar

Level 1

Hi @Bernd ,I tried in Adobe live cycle Designer only..

Avatar

Level 4

[Question moved to the relevant forum]

Avatar

Level 10

Hi,

your syntax is correct so far and the code does exactly what it should. Anyway the whole thing is illogical to me.

I've added a few comments:

var x= this.rawValue;

x = 100; // this replaces the value for 'x' with 100, and makes the assignment of rawValue in the line above obsolete, why?

if(x >= 0 && x <=10000){

    ImageField1.presence = "visible";

    ImageField2.presence = "hidden";

// this part will never be true as 'x' is always 100

} else if(x >= 10001 && x <= 100000){

    ImageField1.presence = "hidden";

    // what should happen to ImageField2 here?

}

The code propably should look the following way and be put into the exit event of a numeric field.

var x = this.rawValue;

if(x >= 0 && x <=10000){

    ImageField1.presence = "visible";

    ImageField2.presence = "hidden";

} else if(x >= 10001 && x <= 100000){

    ImageField1.presence = "hidden";

    ImageField2.presence = "visible";

}