hi everyone.
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()" />
Code:<SCRIPT LANGUAGE="JavaScript"> function confirmCreateNewRecord() { var isConfirmed=confirm('Are you sure you wish to create a new record now? This action cannot be undone or cancelled.') if(isConfirmed) { window.setTimeout('redirectUser()',5000); } } function redirectUser() { 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"); } </SCRIPT>


Reply With Quote


Bookmarks