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
Laxmaya ChnLaxmaya Chn 

Visualforce pop up alert on change of picklist value

Can any one suggest me why I am unable to show an alert message onchange of picklist values in Topic and Subtopic. I am also calling onload controller method in the java script which synchronize Topic and Subtopic.

<apex:pageBlockSection columns="1"> <apex:pageBlockSectionItem > <apex:outputLabel >Select Topic:</apex:outputLabel> <apex:inputField value="{!dummyCase.Topic__c}" onchange="loadSet();" id="st" /> </apex:pageBlockSectionItem> </apex:pageBlockSection> <apex:pageBlockSection columns="1"> <apex:pageBlockSectionItem rendered="{!TopicSelected}"> <apex:outputLabel >Subtopic:</apex:outputLabel> <apex:inputField value="{!dummyCase.Subtopic__c}" onchange="loadSet();"/> </apex:pageBlockSectionItem> </apex:pageBlockSection> <script> function loadSet() { var myPicklistElement = document.getElementById('{!$Component.frm.st}'); var myPicklistValue = myPicklistElement.options[myPicklistElement.selectedIndex].value; if (myPicklistValue == 'value1') { alert('value 1'); // return; } onload(); } </script>
Soundar Rajan PonpandiSoundar Rajan Ponpandi
Hi laxmaya,

Please refere the following link, Kindly let me know if any concern.
 
https://developer.salesforce.com/forums/?id=906F000000097iwIAA

Regards,
Soundar.