Go Back   CodingForums.com > :: Client side development > JavaScript programming

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 03-18-2011, 01:54 AM   PM User | #1
kentax
New to the CF scene

 
Join Date: Mar 2011
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
kentax is an unknown quantity at this point
Question Progress bar !

Hello,
can this upload progress windowsbar be made to close or stop at 100%?
In the upload page the javascript code:

Code:
 <script language="JavaScript">
function input(ok)
{
   	var M1=ok.upload_author.value;
   	if (M1=="")	{
		alert("Author is empty!");   
		return false;
	}
   	M1=ok.upload_title.value;
   	if (M1=="")	{
		//alert("File Description is empty!");
		//return false;
	}
   	if (ok.UploadedFile.value=="")	{
		alert("File is empty!");   
		return false;
	}
	var sCheckType="%checktype";
	if(sCheckType=="1")
  	{
		M1=ok.UploadedFile.value.toLowerCase();
		var pos=M1.lastIndexOf('.',M1.length);
		var sExt;
		if(pos>-1) 
    	   	   sExt=M1.substr(pos+1);
		var sType="%filetype";
		pos=sType.indexOf(sExt);
		if(pos>-1)
		{
			alert("This type of file cannot be uploaded!");   
			return false;
 		}
	}

        ok.uploadid.value=Math.round(Math.random()*100000000);
   	return true;
}
function onstopupload() {
        if(document.post.uploadid.value=="") return;
	window.("uploadstop.ghp?uploadid="+document.post.uploadid.value+"&vfolder="+document.tempform.vfoldername.value) ;

}

function onshowprogress() {
        if(document.post.uploadid.value=="") return;
        window("showprogress.ghp?uploadid="+document.post.uploadid.value+"&vfolder="+document.tempform.vfoldername.value) ;

}

</script>
Then the "Show progress" button which on clik opens in a new window.

Code:
<input name="Upload" type="submit" class=button value="Upload">
                          </font>
                          <input name="stopupload" type="button" class=button id="stopupload" value="Stop" onClick="onstopupload()">
                           <input name="showprogress" type="button" class=button id="showprogress" value="Show upload progress" onClick="onshowprogress()">
And here;s the code from the Progress window.
Code:
<strong>Incarcare %filename...
<br>
%progress%
<br>
<table width="50%" border=1 align="center" cellpadding=0 cellspacing=0>
  <tr>
    <td bgcolor="#FF0000" width="%used%" height=15 style="border:0"> </td>
    <td bgcolor=white width="%left%" height=15 style="border:0"> </td>
  </tr>
</table>
<br>
<a href="showprogress.ghp?uploadid=%uploadid&vfolder=%vfolder">Actualizeaza</a>
&nbsp;
<a href="uploadstop.ghp?uploadid=%uploadid&vfolder=%vfolder">Stop</a>
Plese if anyone knows how to resolve this to pop-up in a window and when it reachis 100% to stop redirecting, or to close it self or by user.

Thanks in advance.

Cira Marius
kentax is offline   Reply With Quote
Reply

Bookmarks

Tags
java, progress bar, script, upload

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 07:50 AM.


Advertisement
Log in to turn off these ads.