+ Start a Discussion
Vandana Rattan 4Vandana Rattan 4 

Visualforce page close button

Is it possible to add Close button just like aClose button on any browser window (X on top right) in Visualforce page?

Thanks,
Vandana
Rahul26Rahul26
Try this

<apex:page> 
   <apex:form>
      <apex:commandbutton onClick="window.top.close();" value="Close"  style="margin-left:95%;"/>
    </apex:form>
 </apex:page>


you can set sidebar or showheader value to False according to your requirement
David Taber 1David Taber 1
Doesn't work in Lightning, at least in Firefox.