views:

86

answers:

1

I have a form sitting in a Thickbox modal in a Symfony project. I am trying to make it so that when the user submits the form, the modal closes, form submits and the parent page refreshes to show the new data (saved to the db). I added to the function tb_remove()

parent.location.reload(1);

This looks like it refreshes the page, but in reality it isn't. Not sure if I need to throw a delay in the function, but when I have I am getting syntax errors. Any help is much appreciated.

A: 

Just needed to move the

parent.location.reload();

into the tb_remove() function (actually created a separate function for this), and put it within the fadeOut function. final function looks like this:

function tb_removeAdminModal() {
  $("#TB_imageOff").unbind("click");
  $("#TB_closeWindowButton").unbind("click");
  $("#TB_window").fadeOut(1000,function(){
    $('#TB_window,#TB_overlay,#TB_HideSelect').trigger("unload").unbind().remove();
    parent.location.reload();
  });
  $("#TB_load").remove();
  if (typeof document.body.style.maxHeight == "undefined") {//if IE 6
   $("body","html").css({height: "auto", width: "auto"});
   $("html").css("overflow","");
  }
  document.onkeydown = "";
  document.onkeyup = "";

  return false;
}
jmarx34