I have visual force page with a custom "Login" button.I need to open login visual force page as modal window, when we click on login button.
I have implemented the code like below:
<apex:commandButton id="Login" onclick="OpenLoginwindow()" value="Log In"/>
function OpenLoginwindow(){var newWin = window.open('apex/Login','PopUp','height=500,width=600,left=150,top=100,resizable=no,scrollbars=yes,toolbar=no,status=no');
}
Here the login page is showing in new window.
But, I want to open login page in a modal window like below:
Please anyone suggest how can I achieve this.
Thanks,
Best Answer
The word "popup" generally means a page opening in new window in front of the current window (see e.g. the Mozilla explanation). It sounds like you want a "modal" instead. You can find a few examples here.
If you are after a modal, Jason "tehnerd" Venable writes a good explanation of how you can create one in Visualforce.
The VF page:
The controller: