I need to Display 5 stars in visualforce then click edit button and select 3 stars then change any object number field have 3 EX: http://jsfiddle.net/grv_bajpai/msLLQ/8/ This link wise display images and select stars are store in a field If any idea

  • 1
    So.... You're halfway there. What is the question exactly ? – CloudHugger Aug 31 '16 at 12:11
  • Hi CloudHugger, My question is display 5 stars in visualforce after that click edit button and select 3 stars But save 3 stars into any object number field have 3 – Lavanya P Aug 31 '16 at 12:16
  • Hi CloudHugger,If you know any idea can you please give me suggestion – Lavanya P Aug 31 '16 at 12:23
  • @mohith suggestion looks like would work fine. If you dont want the libraries and javascript and want to stick with standard visualforce, you would need to have two images available - grey star and yellow star. Your page would retrieve value at setup, and then use loop to render 5 stars. Use conditional image url depending on whether loop value is equal or less than field value. Each image would have link action associated with it to pass value if clicked back to controller, and then refresh the panel the stars are in. This is relatively straight forward code so will leave with you to write. – CloudHugger Aug 31 '16 at 23:14

Here is a small implementation of how this can be done .It uses Javascript remoting in SFDC and uses a jquery based plugin.

There is a unmanaged package to get the code .Please download from here

  • The git has all code .inspect element the browser to see if it is importing all js files directly – Mohith Shrivastava Aug 31 '16 at 12:51
  • Hi Mohith, I need to convert from number field into star rating format. Ex: i create Rating__c number field(5) in account object that field is possible to get the stars(5) rating format in visualforce page using jquery.If you have any idea about that can you please give to me examples – Lavanya P Sep 1 '16 at 12:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.