I have a form that is uploading an image, at present when the user clicks submit the page just sits there loading which is confusing a few users. What I am trying to do is add a loading message when the form is submitted and the image is being uploaded.
The upload is using asp upload if that matters...
form page
saveimage.asp with my effort of a loading message using something I found from dynamic drive
The image is upoaded without problem, but the page is blank whilst uploading still. Once the image is loaded the response.write posts the close window message.
can someone lend a hand please?
The upload is using asp upload if that matters...
form page
Code:
<FORM ENCTYPE="multipart/form-data" ACTION="saveimage.asp" METHOD="POST" name='imageuploadform'>
<label for="file1">Find file</label> <input type='file' name='file1' id='file1' />
<br /><br />
<input type='image' src='/images/forumsubmit.png' name='submit' value='submit' />
</FORM>
saveimage.asp with my effort of a loading message using something I found from dynamic drive
Code:
<html><head><meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1' />
<style type="text/css">
<!--
#loading {
width: 200px;
height: 100px;
background-color: #c0c0c0;
position: absolute;
left: 50%;
top: 50%;
margin-top: -50px;
margin-left: -100px;
text-align: center;
}
-->
</style>
<script type="text/javascript">
<!-- Created by: Robert Paulson : [URL unfurl="true"]http://www.abrahamjoffe.com.au/[/URL] -->
<!-- Begin
document.write('<div id="loading"><br><br>Please wait...</div>');
window.onload=function(){
document.getElementById("loading").style.display="none";
}
// End -->
</script>
</head>
<body >
<%
Set Upload = Server.CreateObject("Persits.Upload")
Upload.Save ( Server.MapPath("/images/") )
response.write "You may now close this window"
%>
</body>
</html>
The image is upoaded without problem, but the page is blank whilst uploading still. Once the image is loaded the response.write posts the close window message.
can someone lend a hand please?