PDA

View Full Version : Delay Page Display with Multiple Forms



Jim Weinberg
10-02-2014, 08:14 PM
I am submitting 2 forms to 2 different pages. One (Form1) goes to my php page for my processing and the other (Form2) goes to an external website for processing. While everything works, it sometime takes the external website a while to connect and display it's page contents. Right now, the user sees a blank screen until the external site responds.

What I'd, ideally, like is for the user to stay on my site until the external site's response is fully loaded (or at least ready to display) and then switch to the new page, so I can display some sort of "processing please wait" message/graphic.

The 2 forms are being submitted using the following code:


document.forms["Form2"].target="_blank";
document.forms["Form2"].submit();
document.forms["Form1"].target="if1";
document.forms["Form1"].submit();


if1 is a iframe I use to redirected to my home page so that when the user closes out the external sites page/tab, they're back on my site.

I've read a lot of comments on displaying a wait message when both pages are your own, but not where one of the pages is outside your control.

Can anyone suggest a way to solve this?

Thanks.

molendijk
10-03-2014, 10:50 AM
Does it help to load the external page in a iframe having 1px width and height, and then give the iframe its normal size after a delay, or after the iframe has loaded the page (<iframe onload=...)?

Jim Weinberg
10-03-2014, 01:52 PM
Hi Arie.

Actually, I tried that approach and nojoy. The external website is contacted but doesn't respond with it's page content. I believe it's a timing issue with the external site, but as I have no control over that, it's a dead end.