Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Icon Button needs to point to another field

Explorer ,
Jun 17, 2024 Jun 17, 2024

I am creating a form where the end user has to upload an image. I am trying to customize it so that there is a masked PNG in front of the upload image form field so that when they upload an image instead of it being a square it will be masked out as a circle. 

 

So all I really need is a javascript that will make the "masked PNG" button point to the "Upload Image" form field so that the end user can upload their image.

 

Let me know if I need to provide anything.

TOPICS
JavaScript , PDF forms
633
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
2 ACCEPTED SOLUTIONS
Community Expert ,
Jun 17, 2024 Jun 17, 2024

Create 2 buttons.  #1 is the image field.  Make it read only.  #2 contains an image with a transparent circle in the midde that is over #1.  It is the same size as #1 and also created 2nd so it is "on top" of #1.  Add a script to #2 that uploads the image to #1.

View solution in original post

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 17, 2024 Jun 17, 2024

Mouse up action:  this.getField("Button1").buttonImportIcon();

View solution in original post

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 17, 2024 Jun 17, 2024

Create 2 buttons.  #1 is the image field.  Make it read only.  #2 contains an image with a transparent circle in the midde that is over #1.  It is the same size as #1 and also created 2nd so it is "on top" of #1.  Add a script to #2 that uploads the image to #1.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jun 17, 2024 Jun 17, 2024

Yes, this is exactly what I have done. My only issue is what is the script that will upload the image to #1? sorry, I do not know much about javascript

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 17, 2024 Jun 17, 2024

Mouse up action:  this.getField("Button1").buttonImportIcon();

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jun 17, 2024 Jun 17, 2024

thank you, I tried this script but it does not do anything.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 17, 2024 Jun 17, 2024

1.  Does "Button1" match the actual name of your button field?

2.  Is the layout of "Button1" set to Icon Only in the options tab?

3.  Are there any errors in the console?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jun 18, 2024 Jun 18, 2024

Yes, "Button1" matches the name of the button field and the layout is set to Icon Only but there are no errors. When i click on the image(button) nothing happens, the upload image does not appear.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 18, 2024 Jun 18, 2024
LATEST

Can you upload your file?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines