title: Why form.submit() is fails IE9 , when form in iframe and user coming through gmail
body: <p>I created function to send email with a back link to my site, I'm using codeigniter framework</p>
  
  <p>after user click that particular link (back link) on email, user redirects to my page which has an iframe.</p>
  
  <p>i used that iframe to submit a form with file input, with out page refreshing.</p>
  
  <p><strong>When user coming through that link using gmail in IE9 browser the <code>form.submit()</code> function fails,</strong> in other browsers it works properly and other email(except gmail) too.</p>
  
  <p>pleas help me to find solution </p>
  
  <p>thank you.</p>
  
  <p><strong>update</strong></p>
  
  <p>actually I'm using the ajaxupload jquery library, it fails on the line <code>form.submit();</code> at above scenario   </p>
  
  <pre><code>     /* Creates form, that will be submitted to iframe
       * @param {Element} iframe Where to submit
       * @return {Element} form
       */
      _createForm: function(iframe){
          var settings = this._settings;
  
          // We can't use the following code in IE6
          // var form = document.createElement('form');
          // form.setAttribute('method', 'post');
          // form.setAttribute('enctype', 'multipart/form-data');
          // Because in this case file won't be attached to request                    
          var form = toElement('&lt;form method="post" enctype="multipart/form-data"&gt;&lt;/form&gt;');
  
          form.setAttribute('action', settings.action);
          form.setAttribute('target', iframe.name);                                   
          form.style.display = 'none';
          document.body.appendChild(form);
  
          // Create hidden input element for each data key
          for (var prop in settings.data) {
              if (settings.data.hasOwnProperty(prop)){
                  var el = document.createElement("input");
                  el.setAttribute('type', 'hidden');
                  el.setAttribute('name', prop);
                  el.setAttribute('value', settings.data[prop]);
                  form.appendChild(el);
              }
          }
          return form;
      },
      /**
       * Gets response from iframe and fires onComplete event when ready
       * @param iframe
       * @param file Filename to use in onComplete callback 
       */
      _getResponse : function(iframe, file){            
          // getting response
          var toDeleteFlag = false, self = this, settings = this._settings;   
  
          addEvent(iframe, 'load', function(){                
  
              if (// For Safari 
                  iframe.src == "javascript:'%3Chtml%3E%3C/html%3E';" ||
                  // For FF, IE
                  iframe.src == "javascript:'&lt;html&gt;&lt;/html&gt;';"){                                                                        
                      // First time around, do not delete.
                      // We reload to blank page, so that reloading main page
                      // does not re-submit the post.
  
                      if (toDeleteFlag) {
                          // Fix busy state in FF3
                          setTimeout(function(){
                              removeNode(iframe);
                          }, 0);
                      }
  
                      return;
              }
  
              var doc = iframe.contentDocument ? iframe.contentDocument : window.frames[iframe.id].document;
  
              // fixing Opera 9.26,10.00
              if (doc.readyState &amp;&amp; doc.readyState != 'complete') {
                 // Opera fires load event multiple times
                 // Even when the DOM is not ready yet
                 // this fix should not affect other browsers
                 return;
              }
  
              // fixing Opera 9.64
              if (doc.body &amp;&amp; doc.body.innerHTML == "false") {
                  // In Opera 9.64 event was fired second time
                  // when body.innerHTML changed from false 
                  // to server response approx. after 1 sec
                  return;
              }
  
              var response;
  
              if (doc.XMLDocument) {
                  // response is a xml document Internet Explorer property
                  response = doc.XMLDocument;
              } else if (doc.body){
                  // response is html document or plain text
                  response = doc.body.innerHTML;
  
                  if (settings.responseType &amp;&amp; settings.responseType.toLowerCase() == 'json') {
                      // If the document was sent as 'application/javascript' or
                      // 'text/javascript', then the browser wraps the text in a &lt;pre&gt;
                      // tag and performs html encoding on the contents.  In this case,
                      // we need to pull the original text content from the text node's
                      // nodeValue property to retrieve the unmangled content.
                      // Note that IE6 only understands text/html
                      if (doc.body.firstChild &amp;&amp; doc.body.firstChild.nodeName.toUpperCase() == 'PRE') {
                          doc.normalize();
                          response = doc.body.firstChild.firstChild.nodeValue;
                      }
  
                      if (response) {
                          response = eval("(" + response + ")");
                      } else {
                          response = {};
                      }
                  }
              } else {
                  // response is a xml document
                  response = doc;
              }
  
              settings.onComplete.call(self, file, response);
  
              // Reload blank page, so that reloading main page
              // does not re-submit the post. Also, remember to
              // delete the frame
              toDeleteFlag = true;
  
              // Fix IE mixed content issue
              iframe.src = "javascript:'&lt;html&gt;&lt;/html&gt;';";
          });            
      },        
      /**
       * Upload file contained in this._input
       */
      submit: function(){                        
          var self = this, settings = this._settings;
  
          if ( ! this._input || this._input.value === ''){                
              return;                
          }
  
          var file = fileFromPath(this._input.value);
  
          // user returned false to cancel upload
          if (false === settings.onSubmit.call(this, file, getExt(file))){
              this._clearInput();                
              return;
          }
  
          // sending request    
          var iframe = this._createIframe();
          var form = this._createForm(iframe);
  
          // assuming following structure
          // div -&gt; input type='file'
          removeNode(this._input.parentNode);            
          removeClass(self._button, self._settings.hoverClass);
          removeClass(self._button, self._settings.focusClass);
  
          form.appendChild(this._input);
  
          form.submit();
  
          // request set, clean up                
          removeNode(form); form = null;                          
          removeNode(this._input); this._input = null;            
  
          // Get response from iframe and fire onComplete event when ready
          this._getResponse(iframe, file);            
  
          // get ready for next request            
          this._createInput();
      }
  };
  </code></pre>