cancel
Showing results for 
Search instead for 
Did you mean: 

changes Images

Former Member
0 Kudos

HI All,

I have a requirement where i need to change the Image set in Background based on some other field input.

I thinki have to use Image Field with some scripting(FormCalc).

Please provide valuable inputs how to achieve the same.

Accepted Solutions (1)

Accepted Solutions (1)

chintan_virani
Active Contributor
0 Kudos

Saurav,

Let's assume you have two image elements in your form named as StaticImage1 & StaticImage2. Use Embed Image Data for both in Object palette.

Now you need an ImageField (ImageField1) to display the Image based on some Textfield input say TextField1.

In exit event of TextField1 write the following code in JavaScript

if(textField1.rawValue == "1") // Write your condition here
{
var image = StaticImage1.value.image.value;
ImageField1.rawValue = image;
}
else
{
var image = StaticImage2.value.image.value;
ImageField1.rawValue = image;
}

Chintan

Former Member
0 Kudos

Hi,

Do I need not fill the URL of ImageField1 at design time and what about Embed image Data property of ImageField1?

The script you have provided is not working for me.

var image = StaticImage1.value.image.value; StaticImage1.value is ok but StaticImage1.value.image.value is not coming for me.

Could you provide the same in FormCalc ?

chintan_virani
Active Contributor
0 Kudos

Saurav,

The code line I have given would not come in ALD but you can write it.

Also no need to provide a URL for the ImageField1 element.

Chintan

Former Member
0 Kudos

Thanks Chintan.

Its working.

Answers (0)