Tuesday, November 5, 2013

jQuery Fancybox: do a postback on parent page when closed

If you need the parent page to perform a postback when a child jQuery fancybox is closed, the following solution has worked for me.

Include the following function on the page (or refrenced via external file):
function __doPostBack(eventTarget, eventArgument) {
if (!theForm.onsubmit || (theForm.onsubmit() != false)) {
theForm.__EVENTTARGET.value = eventTarget;
theForm.__EVENTARGUMENT.value = eventArgument;
Then on the fancybox jQuery declaration, include the following:
'autoScale': false,
'width': 800,
'height': 800,
'type': 'iframe',
'scrolling': 'no',
'showCloseButton': true,
afterClose: function () {

No comments:

Post a Comment