I can’t figure out for at least two days now how to do one thing, is it actually possible:
A have a client/user registration form page which opens in a fancybox when register link is clicked.
The users fills out the registration form and preses register button after what he is redirected to ‘registration_complete.php’ page that loads within already opened fancybox (iframe).
So what I need is: if registration is complete, when user closes fancybox main page is reloaded.
If I use 'onClosed' : function(){ parent.location.reload(true); } then also even the registration was not completed (for example client opened registration form but decided no to register and closed fancybox window) the page is anyway reloading.
Is there any way to make reload work only if registration_complete.php page is opened? But if fancybox is closed in form page nothing happens. How to do that?
I think I have solved my own problem. If anyone is interested how:
What I did is I added
$.postinonClosedfunction to check if user have been registered or not, and if is refreshing parent page when fancybox is closed if not do nothing, and this finally worked for me just like needed. Script: