This forum is no longer open and is for reading/searching only.

Please use our new MachForm Community Forum instead.

MachForm Community Forums » MachForm 2

Upload progress ...


  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 16 years ago #
  2. yuniar

    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.


    MachForm Founder

    Posted 16 years ago #
  3. cdaters
    Member

    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 16 years ago #
  4. yuniar

    Thanks for the link! Their demo looks awesome


    MachForm Founder

    Posted 16 years ago #
  5. dominicdevine
    Member

    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 16 years ago #
  6. yuniar

    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


    MachForm Founder

    Posted 16 years ago #
  7. nickydef
    Member

    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 16 years ago #
  8. yuniar

    That's odd. Can you paste me the URL to your form? I'll try it.


    MachForm Founder

    Posted 16 years ago #
  9. jdancisin
    Member

    I am having issues getting this to work as well. The form is still functioning fine, but I am noth seeing the "uploading" message nor the animated gif.

    -jason

    Posted 15 years ago #
  10. yuniar

    Jason, I just checked your form. I see the animated gif and "uploading" worked fine there?

    See it at the bottom, near your form submit button.


    MachForm Founder

    Posted 15 years ago #
  11. christpage
    Member

    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 15 years ago #
  12. redityo

    Hi,

    Could you tell me your form url ? I need to test it .


    MachForm Support

    Posted 15 years ago #
  13. christpage
    Member

    Hi reityo, form url is www.bighill.biz/ddn.htm

    Posted 15 years ago #
  14. yuniar

    christpage -- I just tested your form.
    When I submit the form, I can see the animated loader image next to your form submit button.

    Perhaps try refresh your browser?


    MachForm Founder

    Posted 15 years ago #
  15. drumaboy46
    Member

    Ok I tried this but it only works in safari on the mac and doesn't work in these browsers

    IE7 or 8
    Firefox

    and by only works I mean you see the "please wait" AND loading gif. In all browsers I see loading please wait but not the gif!

    Posted 14 years ago #
  16. yuniar

    Try using the full image path to loading.gif

    Change this line:

    $("#li_buttons").append("<img src=\"images/loader-red.gif\" />");

    put the full path to loader-red.gif there, example:

    $("#li_buttons").append("<img src=\"http://www.example.com/images/loader-red.gif\" />");

    MachForm Founder

    Posted 14 years ago #
  17. drumaboy46
    Member

    still only shows up in Safari. In firefox I only get the message please wait and no gif. BUT in Internet explorer the gif now appears :). I want it to work for Firefox since more people use IE and Firefox I'm sure it has something to do with the java-script maybe 2 down one to go. :)

    Posted 14 years ago #
  18. yuniar

    Hmm.. can you post the URL of your form? I'll check it.
    Or if you don't want to post it here, please mail us directly.


    MachForm Founder

    Posted 14 years ago #
  19. drumaboy46
    Member

    cdintl.net/machform/view.php?id=11 just click the continue button the loader gif and message should show up with out you logging in thanks.

    Posted 14 years ago #
  20. yuniar

    I've tested using Firefox 3.6.3 and able to see the loader gif just fine.
    Perhaps try again and delete your browser cache first?


    MachForm Founder

    Posted 14 years ago #

RSS feed for this topic

Reply »