Appnitro Software Forums » MachForm

Upload progress ...

(7 posts)

  1. Compu
    Member

    MachForm,

    I was wondering if it was possible to get any type of progress indicator for the file uploads. If a progress indicator isn't possible, how about just simply disabling the continue button and displaying an animated gif for the client to get a visual that their file is being uploaded.

    We deal with a lot of .pdf files and they are rather large and take a good deal of time to upload.

    Thanks!
    Jonathan

    Posted 3 months ago #
  2. Hello Jonathan,

    Actually, yes it is possible to disable the continue/submit button and display an animated gif.

    Edit your includes/view-functions.php file, search around line 1830 and you should find these lines:

    <link rel="stylesheet" type="text/css" href="{$css_dir}view.css" media="all" />
    <script type="text/javascript" src="js/view.js"></script>
    {$calendar_js}

    Right below those lines, insert this block of code:

    <script type="text/javascript" src="js/jquery/jquery-core.js"></script>
    <script>
    $(document).ready(function(){
    	var upload_prop   = $("form").attr("enctype");
    	var show_progress = false;
    	if(upload_prop == 'multipart/form-data'){
    		show_progress = true;
    		$("form").submit(function(){
    		$("#saveForm").val("Uploading... Please wait...");
    		$("#saveForm").attr("disabled","disabled");
    		$("#li_buttons").append("<img src=\"images/loader-red.gif\" />");
    		});
    	}
    });
    </script>

    That would display an animated gif when your files being uploaded.

    Posted 3 months ago #
  3. A nice script that would accomplish this nicely is:

    SWFUpload (http://www.swfupload.org/ or http://swfupload.googlecode.com/)

    Demos (or applications of it) can be found here: http://demo.swfupload.org/

    I bet Yuniar could incorporate this (or something similar) into MachForm no problem :)

    Posted 1 month ago #
  4. Thanks for the link! Their demo looks awesome

    Posted 1 month ago #
  5. After adding the above suggested code, my forms now all have the line:

    Warning: Cannot modify header information - headers already sent by (output started at [my site]/machform/includes/view-functions.php:1) in [my site]/machform/view.php on line 89

    Can you please advise as to how I fix this?

    Thanks.

    Posted 3 days ago #
  6. What editor did you use to modify the file?

    That seems to be text editor problem. There is an extra character (non-visible character) being added at the beginning of your "view-functions.php" file.

    Try to restore that file with the original and then redo the modification using another text editor.

    I suggest to use Notepad++:
    http://notepad-plus.sourceforge.net

    Posted 3 days ago #
  7. This works fine - but doesn't display the animated .gif during the upload? It does disable the button and say "Uploading...Please wait..." but no .gif displayed?

    Posted 9 hours ago #

RSS feed for this topic

Reply

You must log in to post.