I have the following code to open a form in a popup window. I want to, after clicking the submit button, have an alert popup after 1250 milliseconds. This does not currently work as the page gets redirected to the result of submitting the form.
<?php
$blah = "Well"; $test = "Done";
echo '<script type="text/javascript" src="fetchlayers.js"></script>';
$formcode = "<form action=\"process.php\" method=\"post\" enctype=\"multipart/form-data \"><label for=\"file\">Filename:</label><input type=\"file\" name=\"file\" id=\"file\"/> <br /><input type=\"submit\" name=\"submit\" value=\"Submit\" onclick=\"setTimeout(function() { alert('$blah'); },1250);\" /></form>";
echo "<h1>hello</h1>
<div id='form'>
<a href='#' onclick=\"createpopup('" . htmlentities($formcode) . "'); return false;\">
click here</a>
</div>";
What would be the best way to have a delayed action after submitting a form?