Link to home
Start Free TrialLog in
Avatar of jkeagle13
jkeagle13

asked on

Refresh Page after InfoPath Form Submit

Hello,

I have a SharePoint 2010 page with an embedded InfoPath Form web part.

My goal is to get the entire page to refresh when the InfoPath form is submitted. Is there any way that can be easily done?

Thanks,
Joseph Irvine
Avatar of rbrogan_ee
rbrogan_ee

Using jquery

$('input[type="submit"]').click(function() {
  document.location.href = url;  // set this to the url you want to refresh
});
Avatar of jkeagle13

ASKER

Is there any chance that this would refresh the page before the data had committed?

If, for whatever reason, there were a lag/bottleneck, would it preempt the record being saved? If the page refreshed too soon, might it cancel the committing of data?

Preserving data is of the utmost importance. I have noticed that on pushing the submit button as-is without this code, it spins for a few seconds on "Saving Record." There are 60+ fields in the form.

Thanks,
Joseph Irvine
Additionally, it isn't working.

Is there some code necessary to scope it down to the embedded InfoPath form? This isn't a regular HTML button of action "Submit."

Thanks!
Joseph Irvine
ASKER CERTIFIED SOLUTION
Avatar of rbrogan_ee
rbrogan_ee

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Wound up simplifying it a bit:

$(document).ready(function(){
if($('#DialogFinalMessage').children().length>0)
{
      var start = new Date().getTime();
      while (new Date().getTime() < start + 4000){}
      window.location.href = $(location).attr('href');
}
});

That looks for the dialog message that shows if you set one of the submit actions to close the form. It is working for me.

Thanks for your help!
Joseph Irvine