Check if there is an photo uploaded in an image field
How can I check if a photo is uploaded in an image field using a script? I want to show it in a text field as a status.
How can I check if a photo is uploaded in an image field using a script? I want to show it in a text field as a status.
That's exactly what my script does. You need a trigger. The mouseup action of the button is the trigger. Calculation scripts only change when field values change. An image added to a button field is not a value change. What do you mean "prompt"? If you insist on making this a custom calculation script in the text field you would change the script to the following (assuming "Button1" is the image field name):
var icn=this.getField("Button1").buttonGetIcon();
var status="Has image";
try{util.iconStreamFromIcon(icn)}catch(e){status="Does not have image."}
event.value=status;
You will still need to modify the mouseup action of the image field so the change happens immediately by adding this line of code to the mouse up action:
this.calculateNow();
Already have an account? Login
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.