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
ShravanKumarBagamShravanKumarBagam 

How can i close a popup window by onclick event in salesforce

Best Answer chosen by Admin (Salesforce Developers) 
Navatar_DbSupNavatar_DbSup

Hi,

 

If you want to close the pop-up window by clicking on the button present in pop-up window then, you have to write the below code in javascript

<script>

 

function ClosePopup()

   {

       window.parent.close();        

   }

</script>  

<apex:commandButton id="btn" oncomplete="ClosePopup();" value="Submit" />

 

Did this answer your question? If not, let me know what didn't work, or if so, please mark it solved.