cjkeane — 2011-03-24T16:24:50-04:00 — #1
i need to delay a page from opening a new window for a minimum of 5 seconds to allow some php processing (inserting a new record into a table) to occur first. the open window code works fine without the time delay, but as soon as i attempt to put a delay in, nothing happens eg, the page no longer opens a new window called newrecord.php. i'd appreciate some help. thx.
a submit button calls the function like so:
<input type="submit" name="AddRecord" id="AddRecord" value="Add New Record" onClick="confirmCreateNewRecord()" />
var isConfirmed=confirm('Are you sure you wish to create a new record now? This action cannot be undone or cancelled.')
window.open("newrecord.php?ID=<?php echo $ID ?>","_blank","toolbar=no, location=yes, status=no, menubar=no, scrollbars=yes, resizable=yes, width=800, height=550");
pablogo — 2011-03-28T10:09:32-04:00 — #2
May be a popup blocker problem.
When the function fires the "redirectUser()" without the delay it work because it's in the same "event scope" that it happens, so, the browsers "thinks" "ok, this popup is what the user want to see".
So, check your popup blocker rules to see if this is what is happening.
cjkeane — 2011-03-28T12:23:50-04:00 — #3
Thanks for the reply.