title: Jquery Form Plugin: how to show progress bar only when form has enctype tag
body: <p>I'm using Jquery Form Plugin to submit data via Ajax and I've no problem.
  I also implemented the progress bar successfully.</p>
  
  <p>I wish to show progress bar only when the form has the tag enctype="multipart/form-data", but I've problem to read form attributes inside AjaxForm object:</p>
  
  <pre><code>$('.form_to_main').ajaxForm({
      delegation: true,
      target: '#main_content',
      beforeSend: function(arr, myform, options) {
        _is_loading = true;
        $('#loading').fadeIn();
        //here something like if($(myform).attr("enctype") != '')
        $('#loading .progress_bar .bar_container .bar').width('0%')
        $('#loading .progress_bar .percent').html('0%');
        //else $('#loading .progress_bar).hide();
      },
      beforeSubmit: function() {
        if (_is_loading) return false;
      },
      uploadProgress: function(event, position, total, percentComplete) {
        $('#loading .progress_bar .bar_container .bar').width(percentComplete + '%')
        $('#loading .progress_bar .percent').html(percentComplete + '%');
      },
      error: function(xhr) {
        BoxErrorShow('Connection error: ' + xhr.status + ' ' + xhr.statusText);
        $('#loading').hide();
        _is_loading = false;
      },
      success: function() {
        $('#loading .progress_bar .bar_container .bar').width('100%')
        $('#loading .progress_bar .percent').html('100%');
        $('#loading').hide();
        _is_loading = false;          
      }
    });
  });
  </code></pre>
  
  <p>In the beforeSend: method I want to check the enctype attribute, but it's not clear to me ho to access to form object.</p>
  
  <p>Thanks for the support</p>
  
  <p>UPDATE - SOLVED
  I use the beforeSubmit parameters in beforeSend function.
  So the correct code is the following:</p>
  
  <pre><code>$('.form_to_main').ajaxForm({
      delegation: true,
      target: '#main_content',
      beforeSend: function() {
        _is_loading = true;
        $('#loading').fadeIn();
        $('#loading .progress_bar .bar_container .bar').width('0%')
        $('#loading .progress_bar .percent').html('0%');
      },
      beforeSubmit: function(arr, myform, options) {
        if ($(myform).attr("enctype") == 'multipart/form-data') $('#loading .progress_bar').show();
        if (_is_loading) return false;
      },
      uploadProgress: function(event, position, total, percentComplete) {
        $('#loading .progress_bar .bar_container .bar').width(percentComplete + '%')
        $('#loading .progress_bar .percent').html(percentComplete + '%');
      },
      error: function(xhr) {
        BoxErrorShow('Connection error: ' + xhr.status + ' ' + xhr.statusText);
        $('#loading').hide();
        _is_loading = false;
      },
      success: function() {
        $('#loading .progress_bar .bar_container .bar').width('100%')
        $('#loading .progress_bar .percent').html('100%');
        $('#loading .progress_bar').hide();
        $('#loading').hide();
        _is_loading = false;
      }
    });
  });
  </code></pre>