Skip to main content
August 29, 2016
Answered

How do I program a button to retreive an image from a users database and insert into a form field?

  • August 29, 2016
  • 1 reply
  • 1119 views

​I need help (I don't have a clue) with a java script  to program a button to retreive an image from a users database and insert into a form field. Basically to go to the Select Icon menu.

[edited by moderator - there was no body to the post and it was all in one long title header. Shortened the title and pasted the original, full length title as the body to the post]

This topic has been closed for replies.
Correct answer try67

OK, that's quite easily done. As the button's MouseUp event, select "Execute JavaScript" and then enter this code:

event.target.buttonImportIcon();

When you then click the button it will open a file selection dialog, and the selected file will be displayed as the button's icon.

1 reply

try67
Community Expert
Community Expert
August 29, 2016

You can only do that if the script is installed on the user's local machine. And of course, you need to know the full path of the image file.

Otherwise, the used will need to select it manually.

August 29, 2016

That's correct. The intent is for the user to manually select the image file from their computer data base.  I just want the button to re-direct to the button/properties/choose icon/ select icon menu.

Thank you.

try67
Community Expert
try67Community ExpertCorrect answer
Community Expert
August 29, 2016

OK, that's quite easily done. As the button's MouseUp event, select "Execute JavaScript" and then enter this code:

event.target.buttonImportIcon();

When you then click the button it will open a file selection dialog, and the selected file will be displayed as the button's icon.