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
SV MSV M 

Need alert on selecting picklist value

I would like to create an alert selecting picklist value and the alert should display the value of picklist which I have selected. I tried the below code but no luck.
<apex:page standardController="Account" recordSetVar="Accounts" sidebar="False"> <apex:form > <apex:pageBlock > <apex:pageBlockSection title="Details"> <apex:pageBlockTable value="{!Accounts}" var="a"> <apex:column value="{!a.name}"/> <apex:column value="{!a.Type}"/> <apex:column value="{!a.Website}"/> <apex:column headerValue="Details"> <apex:commandButton value="Details" onclick="showAlert('{!a.Name}')"/></apex:column> </apex:pageBlockTable> </apex:pageBlockSection> </apex:pageBlock> </apex:form> <script> function showAlert(accountName){ alert('HELLO ' + accountName); } </script> </apex:page>
Can anyone help me achieve this.
Devi ChandrikaDevi Chandrika (Salesforce Developers) 
Hi sai,

Please refer below link which might help you in this
https://salesforce.stackexchange.com/questions/180099/how-to-display-alert-popup-based-on-a-value-by-selecting-an-account

Hope this helps you
Let me know if this helps you. Kindly mark it as solved so that it may help others in future.

Thanks and Regards
SV MSV M
Hi @Devi Chandrika
I already tried that one but I need to show alert without using Apex class. Can you help me on how to achieve that.
Nila Mani DasNila Mani Das
This update is for anyone who is also facing same issue now. Well instead of Apex Class, it can be done by Rich Text. Open your Record in Lightning, click on Edit Page in your gear Icon and then look for Rich Text on left hand side Panel. Write your text and in Below you give your condition. Simple