function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
SimrinSimrin 

Using image as command button

Hello,

I have added a image as static resources.
How can i use it as command button.
Best Answer chosen by Simrin
ManojjenaManojjena
Hi Simrin,

You can use below code .
<apex:commandButton action="{!save}"  id="theButton" value="{!$Resource.StaticResourceName}"/>

Any issue please let me know .

All Answers

ManojjenaManojjena
Hi Simrin,

You can use below code .
<apex:commandButton action="{!save}"  id="theButton" value="{!$Resource.StaticResourceName}"/>

Any issue please let me know .
This was selected as the best answer
SimrinSimrin
<apex:commandButton action="{!add}"  id="theButton"  image="{!URLFOR($Resource.add)}" reRender="idForm"/>

works wel but the image is too big
ManojjenaManojjena
HI Simrin,

Use below code it will set both height and width to the image .
 
<apex:commandButton action="{!add}" id="theButton" image="{!URLFOR($Resource.add)}" reRender="idForm" style=" height: 100px;  width: 100px;"/>