Pastebin launched a little side project called HostCabi.net, check it out ;-)Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Feb 18th, 2013  |  syntax: None  |  size: 1.87 KB  |  hits: 23  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. <input type="hidden" name="imgname" id="imgname" value="" />
  2.        
  3. <script type="text/javascript">
  4.     $(document).ready(function() {
  5.         //elements
  6.         var progressbox     = $('#progressbox');
  7.         var progressbar     = $('#progressbar');
  8.         var statustxt       = $('#statustxt');
  9.         var submitbutton    = $("#SubmitButton");
  10.         var myform          = $("#UploadForm");
  11.         var output          = $("#output");
  12.         var lotterydiv      = $("#lottovidpreview");
  13.         var completed       = '0%';
  14.  
  15.         $(myform).ajaxForm({
  16.             beforeSend: function() { //brfore sending form
  17.                 lotterydiv.remove();
  18.                 submitbutton.attr('disabled', ''); // disable upload button
  19.                 statustxt.empty();
  20.                 progressbox.slideDown(); //show progressbar
  21.                 progressbar.width(completed); //initial value 0% of progressbar
  22.                 statustxt.html(completed); //set status text
  23.                 statustxt.css('color','#000'); //initial color of status text
  24.             },
  25.             uploadProgress: function(event, position, total, percentComplete) { //on progress
  26.                 progressbar.width(percentComplete + '%') //update progressbar percent complete
  27.                 statustxt.html(percentComplete + '%'); //update status text
  28.                 if(percentComplete>50) {
  29.                     statustxt.css('color','#fff'); //change status text to white after 50%
  30.                 }
  31.             },
  32.             complete: function(response) { // on complete
  33.                 output.html(response.responseText); //update element with received data
  34.                 myform.resetForm();  // reset form
  35.                 submitbutton.removeAttr('disabled'); //enable submit button
  36.                 progressbox.slideUp(); // hide progressbar
  37.             }
  38.         });
  39.     });
  40.  
  41. </script>
  42.        
  43. $("#imagename").val($("#filepc").val());