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
TilakTilak 

How to make an already selected radio option bold on pageload?

The following code makes the label of the radio option bold when it is changed.

 

<apex:selectRadio value="{!npiData}" id="npiOptions">
<apex:selectOption itemValue="Include" itemLabel="Store NPI Data"/>
<apex:selectOption itemValue="Do Not Include" itemLabel="Do not store NPI data"/>
</apex:selectRadio>

 

 

Jquery code - 

//Highlight of NPI-Option text
j$('[id$=npiOptions] input').change(function(){
j$('#npiDiv').removeClass('hilite');
j$('[id$=npiOptions] label').removeClass('hilite');
j$(this).next('label').addClass('hilite');
});

 

<style> .hilite{ font-weight:bold; } </style>

 

Now, my requirement is that if I have selected "Store NPI Data", saved it and moved on to other pages. When I come back to this page again, the "Store NPI Data" option is selected and its label should also be highlighted.