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
SwayampravaSwayamprava 

Clickable image should do some field update every time it is clicked

Hi How a image should be a clickable image and it should do some operation on background when ever it is clicked. and update another field on the same object . 

Best Answer chosen by Admin (Salesforce Developers) 
TejTej

If it is a Visualforce pageyou can use this tag and write a javascript function to invoke a method in your controller

 

<apex:image value="{!$Resource.Test}" onclick="jsFunction('{!Id}');"/>

 

 

All Answers

TejTej

If it is a Visualforce pageyou can use this tag and write a javascript function to invoke a method in your controller

 

<apex:image value="{!$Resource.Test}" onclick="jsFunction('{!Id}');"/>

 

 

This was selected as the best answer
SwayampravaSwayamprava

Thanks for Your solution. But I am new to VF pages. Can you give some extra hints?