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
DevelopementDevelopement 

Javascript not running on VF page

Hi,

I want when oppy stage is closed won. user should get pop up. i create this page. But the popup is not coming. even when i preview the page , nothing shows up.
<apex:page standardController="opportunity" rendered="{!opportunity.stagename="Closed Won"}">
  <script type="text/javascript">
  {
  window.alert("i did it");
  }
  </script>
  
</apex:page>

please help to resolve this.
Best Answer chosen by Developement
Naval Sharma4Naval Sharma4
Hi,

Use the below code.
<apex:page standardController="opportunity" rendered="{!opportunity.stagename="Closed Won"}">
  <script>
         window.alert("i did it");
  </script>
  
</apex:page>

and please make sure that stage of your opportunity record is "Closed Won".

All Answers

Naval Sharma4Naval Sharma4
Hi,

Use the below code.
<apex:page standardController="opportunity" rendered="{!opportunity.stagename="Closed Won"}">
  <script>
         window.alert("i did it");
  </script>
  
</apex:page>

and please make sure that stage of your opportunity record is "Closed Won".
This was selected as the best answer
DevelopementDevelopement
Thanks