How to hide the Imagefield using java script?

Avatar

Avatar
Level 1
patanr89952546
Level 1

Likes

0 likes

Total Posts

3 posts

Correct reply

0 solutions
View profile

Avatar
Level 1
patanr89952546
Level 1

Likes

0 likes

Total Posts

3 posts

Correct reply

0 solutions
View profile
patanr89952546
Level 1

30-04-2017

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";

}

Accepted Solutions (0)

Answers (5)

Answers (5)

Avatar

Avatar
Coach
MVP
radzmar
MVP

Likes

397 likes

Total Posts

2,687 posts

Correct reply

492 solutions
Top badges earned
Coach
Ignite 3
Ignite 1
Validate 1
Give Back 50
View profile

Avatar
Coach
MVP
radzmar
MVP

Likes

397 likes

Total Posts

2,687 posts

Correct reply

492 solutions
Top badges earned
Coach
Ignite 3
Ignite 1
Validate 1
Give Back 50
View profile
radzmar
MVP

01-05-2017

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";

}

Avatar

Avatar
Boost 5
Level 2
try67
Level 2

Likes

14 likes

Total Posts

120 posts

Correct reply

1 solution
Top badges earned
Boost 5
Boost 3
Boost 10
Boost 1
Affirm 1
View profile

Avatar
Boost 5
Level 2
try67
Level 2

Likes

14 likes

Total Posts

120 posts

Correct reply

1 solution
Top badges earned
Boost 5
Boost 3
Boost 10
Boost 1
Affirm 1
View profile
try67
Level 2

01-05-2017

[Question moved to the relevant forum]

Avatar

Avatar
Level 1
patanr89952546
Level 1

Likes

0 likes

Total Posts

3 posts

Correct reply

0 solutions
View profile

Avatar
Level 1
patanr89952546
Level 1

Likes

0 likes

Total Posts

3 posts

Correct reply

0 solutions
View profile
patanr89952546
Level 1

01-05-2017

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

Avatar

Avatar
Level 1
patanr89952546
Level 1

Likes

0 likes

Total Posts

3 posts

Correct reply

0 solutions
View profile

Avatar
Level 1
patanr89952546
Level 1

Likes

0 likes

Total Posts

3 posts

Correct reply

0 solutions
View profile
patanr89952546
Level 1

01-05-2017

Yes I tried on Form  live cycle designer

Avatar

Avatar
Boost 5
Level 2
Bernd_Alheit
Level 2

Likes

5 likes

Total Posts

65 posts

Correct reply

4 solutions
Top badges earned
Boost 5
Boost 3
Boost 1
Affirm 3
Affirm 1
View profile

Avatar
Boost 5
Level 2
Bernd_Alheit
Level 2

Likes

5 likes

Total Posts

65 posts

Correct reply

4 solutions
Top badges earned
Boost 5
Boost 3
Boost 1
Affirm 3
Affirm 1
View profile
Bernd_Alheit
Level 2

01-05-2017

Try the forum for LiveCycle Designer.