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 ...
Started 16 years ago by Compu | 38 posts |
-
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!
JonathanPosted 16 years ago # -
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 # -
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 # -
Thanks for the link! Their demo looks awesome
MachForm Founder
Posted 16 years ago # -
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 # -
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.netMachForm Founder
Posted 16 years ago # -
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 # -
That's odd. Can you paste me the URL to your form? I'll try it.
MachForm Founder
Posted 16 years ago # -
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 # -
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 # -
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 # -
Hi,
Could you tell me your form url ? I need to test it .
MachForm Support
Posted 15 years ago # -
Hi reityo, form url is www.bighill.biz/ddn.htm
Posted 15 years ago # -
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 # -
Ok I tried this but it only works in safari on the mac and doesn't work in these browsers
IE7 or 8
Firefoxand 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 # -
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 # -
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 # -
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 # -
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 # -
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 #
Reply »
You must log in to post.