Copy link to clipboard
Copied
one Button created. also imported .png file. When I click the button It hide the picture and When I click the button again it unhide the picture. (I want to do like that) How can I do? plz help me!
Copy link to clipboard
Copied
In 'Prepare form' tool you can add 'image field' close 'Prepare form' and click on that field to import image.
Now in a button as 'Mouse UP' event, select 'Run a JavaScript' and enter this script and make sure field name is same as your actual field name:
this.getField("Image1_af_image").display = this.getField("Image1_af_image").display == display.visible ? display.hidden : display.visible;
Copy link to clipboard
Copied
The only way to hide an image with a script is if that image is the icon of a button field, or if you use a button (or any other type of field) to hide it underneath it. Either way, it will require using a script, like the one Nesa provided above.
Just to clarify, though, when the image is hidden there will be a white gap on the page. It will not cause the rest of the page's contents to "reflow" and fill that gap.
Copy link to clipboard
Copied
In 'Prepare form' tool you can add 'image field' close 'Prepare form' and click on that field to import image.
Now in a button as 'Mouse UP' event, select 'Run a JavaScript' and enter this script and make sure field name is same as your actual field name:
this.getField("Image1_af_image").display = this.getField("Image1_af_image").display == display.visible ? display.hidden : display.visible;
Copy link to clipboard
Copied
Thanks.
Copy link to clipboard
Copied
This works great. I'm a little disappointed that I need to click away first and then click again to toggle the image.
I tried one time to add a few more lines to the same javascript
this.getField("Circled.1").display = this.getField("Circled.1").display == display.visible ? display.hidden : display.visible;
this.getField("Circled.2").display = this.getField("Circled.2").display == display.visible ? display.hidden : display.visible;
this.getField("Circled.3").display = this.getField("Circled.3").display == display.visible ? display.hidden : display.visible;
And so, I click once and circled.1 displays. I click again, circled.1 disappears and Circled.2 and Circled.3 appear at the same time. Ugh...surely I can set up a single button - to "draw a circle around the day of the week"? The form should only have one of the 7 days circled.
Thanks again.
Copy link to clipboard
Copied
Perhaps if you share your file and describe the workflow you wish to achieve, we can probably help.
Copy link to clipboard
Copied
Nessa,
Thank you for responding. I saw your request to share and with great senility shared on another post. I would love to resolve this. I only just now found this again. I'm wondering if I'm in two different support sites and that is why I am confused? Sorry. If you are okay, I would like to pursue this further. I just need to go sit at my desk and review this and upload.
Copy link to clipboard
Copied
The only way to hide an image with a script is if that image is the icon of a button field, or if you use a button (or any other type of field) to hide it underneath it. Either way, it will require using a script, like the one Nesa provided above.
Just to clarify, though, when the image is hidden there will be a white gap on the page. It will not cause the rest of the page's contents to "reflow" and fill that gap.

