(If statement) to insert image based on a value.
I am using AutoMailMerge and I am trying to add a JavaScript to check if a field value is "1" then insert image in the image field. It's working with this code, but it doesn't do the else if conditions, all exported/processed PDFs contains the first image only (Circle1.png).
This is the code:
var f = this.getField("Image1_af_image");
if (f.value = 1)
{
f.buttonImportIcon("C:/Users/EslamSamy/Desktop/Circle1.png");
} else if (f.value = 2)
{
f.buttonImportIcon("C:/Users/EslamSamy/Desktop/Circle2.png");
} else if (f.value = 3)
{
f.buttonImportIcon("C:/Users/EslamSamy/Desktop/Circle3.png");
}
