Triks

  • Клонирование file type='input' http://jsfiddle.net/E8DBZ/2/
    • CSS
      #modal {
          padding: 10px;
          background: #eee;
      }
    • Views
      <form id="frm">
          <!-- form can contain plenty of inputs -->
      </form>
       
      <div id="modal">
          <h2>Modal</h2>
          <div id="file-input-wrapper">
              <input id="modal-file-input" type="file" name="file" />
          </div>
          <br /><br />
          <input id="submit-modal" type="submit" value="submit modal" />
      </div>
    • JS
      $('body').on('click', '#submit-modal', function(e) {
          e.preventDefault();
          var $form = $('#frm');
          var $fileInput = $('#modal-file-input');
          var $fakeInput = $fileInput.clone();
       
      	$form.append($fileInput);
          $('#file-input-wrapper').append($fakeInput);
      });