Display a grapic - I know it's simple, but I just can't get it to work
Right now I've got a terrible sinus condition so my brain probably isn't functioning properly. I'm hoping someone will take pity on me and help me out.
I've got a simple HTML page used to specify files for uploading. The uploading is done with a PHP routine. It works fine except that larger files take a long time. I just want to display an animated 'wait' gif while the php file processes. I want it to display in the middle of the page (not in a new window) when the Submit button is clicked (after checking to make sure the userid and password have been entered). I know that's simple, but I just can't get it to work. Here's the HTML code. I've put in a comment where (when) I want the graphic to display.
HTML Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html><head><title>File Upload Page</title><script type="text/javascript">
function checkrequired(which) {
var pass=true;
if (document.images) {
for (i=0;i<which.length;i++) {
var tempobj=which.elements[i];
if((tempobj.name == "user" || tempobj.name == "passwd") && tempobj.value=='') {
pass=false;
break;
}
}
}
if (!pass) {
shortFieldName=tempobj.name.substring(0,30).toUpperCase();
alert("Please enter your Username and Password");
tempobj.focus();
return false;
}
else
// DISPLAY GRAPHIC NOW
return true;
}
</script></head><body><p> <p><p><font size=+2><center>
Welcome to the File Uploader.
<p> <p><table align="center" valign="middle" border=2><tr><td><table border=0><tr><td align="center"><form enctype="multipart/form-data" action="uploader.php" method="post" onsubmit="return checkrequired(this);"><input type="hidden" name="MAX_FILE_SIZE" value="3000000" /><p>Select up to five files to upload.<br>File size must be less than 2.4MB.<br><input name="graphicfile[]" type="file" size=40 value=""><br><input name="graphicfile[]" type="file" size=40 value=""><br><input name="graphicfile[]" type="file" size=40 value=""><br><input name="graphicfile[]" type="file" size=40 value=""><br><input name="graphicfile[]" type="file" size=40 value=""><br></td></tr><tr height=20><td align="center" valign="middle"><u>User Authorization</u></td></tr><tr><td>Username: <input type='text' name='user' > Password: <input type='password' name='passwd'><br><center>Note: Both Username and Password are case sensitive.</td></tr><tr height=40><td align="center" valign="bottom"><input value="Upload Files" type="submit"></p></td></form></table></td></tr></table></body>
Bookmarks