+ Start a Discussion
Dale WorthingtonDale Worthington 

Javascript alert based on piclist

Hi All

Im trying to alert based on a picklist, my example is below. 
My understanding is that this should work... Is there something im missing?
 
<apex:page StandardController="Opportunity">

    <script>
    
        if({!Opportunity.StageName}=="Contract Signed")
        
            alert('Alert Box');
            
    </script>

</apex:page>

 
Dale WorthingtonDale Worthington
To note; this page is then inserted into the opportunity record :)
Swayam@SalesforceGuySwayam@SalesforceGuy
Hi,

You need to update the script  use '{! }' 
 
<apex:page StandardController="Opportunity">

    <script>
    
        if('{!Opportunity.StageName}'== 'Contract Signed')
        
            alert('Alert Box');
            
    </script>

</apex:page>


Hope this helps !!
--
Thanks,
Swayam