Loaded image in Image field makes Text field visible + required
Hi,
I am creating form in Acrobat Pro to allows users to insert images via the Image Field function. Once an image is inserted, a text field below is required to be filled in.
I have created a javascript code for a similar scenario involving checkboxes. However, I have been unable to locate the correct terminology to reference the Image Field. Below is the Javascript code for the checkbox scenario.
event.target.buttonImportIcon();
var showHide = event.target.isBoxChecked(0)?display.visible:display.hidden;
this.getField("Photo1_Caption").display = showHide;
if(event.target.value == "Yes") {
// console.println("Checked " + event.value);
this.getField("Photo1_Caption").required = true;
}
else {
// console.println("Not " + event.value);
this.getField("Photo1_Caption").required = false;
}
Using the above code as a guide, is it possible for some assistance to achieve the following end outcome please:
- If image is inserted into Image Field, the text field is made visible and required
- If no image is inserted into Image Field, the text field remains hidden
- If image is cleared from the Image Field, the text field becomes hidden and not required
Thank you kindly in advance for your help.
Tim
