how to do progess bar
Hi this is my page which is used for uplading pictures. can i know how to put progress bar with % of completing staus in it.
<script language="javascript">
var ModalDialogWindow;
var ModalDialogInterval;
var ModalDialogEventHandler = '';
function ModalDialogMaintainFocus()
{
try
{
if (ModalDialogWindow.closed)
{
window.clearInterval(ModalDialogInterval);
eval(ModalDialogEventHandler);
return;
}
ModalDialogWindow.focus();
}
catch (everything) { }
}
function ModalDialogRemoveWatch()
{
ModalDialogEventHandler = '';
}
function ModalDialogShow(Title)
{
ModalDialogRemoveWatch();
ModalDialogEventHandler = ModalDialogRemoveWatch();
var args='width=350,height=150,left=325,top=300,toolba r=0,';
args+='location=0,status=0,menubar=0,scrollbars=0, resizable=0';
ModalDialogWindow=window.open("","",args);
ModalDialogWindow.document.open();
ModalDialogWindow.document.write('<html>');
ModalDialogWindow.document.write('<head>');
ModalDialogWindow.document.write('<title>' + Title + '</title>');
ModalDialogWindow.document.write("<" + "script language=javascript" + ">");
ModalDialogWindow.document.write("onerror=errhandl e;");
ModalDialogWindow.document.write("function errhandle() {return true}");
ModalDialogWindow.document.write('var ctr = 1; var ctrMax = 20; var intervalId;');
ModalDialogWindow.document.write('intervalId = window.setInterval("ctr=UpdateIndicator(ctr, ctrMax)", 600);');
ModalDialogWindow.document.write('function UpdateIndicator(curCtr, ctrMaxIterations) {');
ModalDialogWindow.document.write('/*alert(window.opener.document.form1.progress.value );*/if(window.opener.document.form1.progress){if (window.opener.document.form1.progress.value != "waiting" ) window.close();}else {window.close();}');
ModalDialogWindow.document.write('curCtr += 1;');
ModalDialogWindow.document.write('if (curCtr <= ctrMaxIterations) {');
ModalDialogWindow.document.write('indicator.style. width = curCtr*10 +"px";');
ModalDialogWindow.document.write('return curCtr;}');
ModalDialogWindow.document.write('else {indicator.style.width=0; return 1;}}');
ModalDialogWindow.document.write("<" + "/" + "script" + ">");
ModalDialogWindow.document.write('</head>');
ModalDialogWindow.document.write('<body onblur="window.focus();" margintop="0">');
ModalDialogWindow.document.write('<table border=0 width="95%" align=center cellspacing=0 cellpadding=2>');
ModalDialogWindow.document.write('<tr><td>');
ModalDialogWindow.document.write('<div align=center><h5>Please be patient. Image Uploads may take several minutes</h5></div>');
ModalDialogWindow.document.write('<table border="0" width="100%"><tr><td width="10%"></td><td width="80%">');
ModalDialogWindow.document.write('<table id=indicator border="0" cellpadding="0" cellspacing="0" width="0" height="20">');
ModalDialogWindow.document.write('<tr><td bgcolor="red" width="100%"></td></tr></table>');
ModalDialogWindow.document.write('</td><td width="10%"></td></tr></table>');
ModalDialogWindow.document.write('</td></tr>');
ModalDialogWindow.document.write('<tr><td align=center>');
ModalDialogWindow.document.write('<a href=javascript:window.close();>Close</a> ');
ModalDialogWindow.document.write('</td></tr>');
ModalDialogWindow.document.write('</table>');
ModalDialogWindow.document.write('</body>');
ModalDialogWindow.document.write('</html>');
ModalDialogWindow.document.close();
ModalDialogWindow.focus();
ModalDialogInterval = window.setInterval("ModalDialogMaintainFocus()",5) ;
}
function ShowPopup()
{
document.form1.progress.value = "waiting";
ModalDialogShow("Processing your request ...");
return true;
}
</script>
|