Set button icon using javascript

How to set an icon of a button?
For example, how to set the icon of a button named 0015 to "c:\images\dummy.jpg"?
I might need to change the button to "Icon only" prior to that.
Who is Participating?
Karl Heinz KremerCommented:
Oops - Update: I just realized that you want to do this with JavaScript

To do that you (as you correctly suggest) will have to change the layout mode first using the "buttonPosition" property of your field. See here for more information:

To import the image, you would use buttonImportIcon():

If you want to specify a path, there are security implications: You can only do that during a batch or a console event.
Karl Heinz KremerCommented:
You open up the button properties dialog, then go to the "Options" tab:

Button Properties - Icon
You can now select one of the layout options that uses an icon, once that is done, the "Choose Icon..." button will become available, and you can navigate to your icon file.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.