title: placing focus on input box in IE
body: <p>I have the following situation in a web application I am working on:</p>
  
  <p>I have a form with a set of index field values that a user enters information into and then submits the form to the server.  Field validation takes place on the server.  If any field is found to be invalid, the form is redisplayed and I want to the input focus to automatically go to the first invalid field. I have the code in place to make it happen but the problem is that the focus is not being placed on the field in IE 10 (yet it is being placed in Firefox).  </p>
  
  <pre><code>  placefocusonfirstinvalidindexfield();
  
    // After an attempt to upload has failed due to one or more invalid fields, then place the input focus automatically on the first
    // invalid field:
    function placefocusonfirstinvalidindexfield() {
      var hasattemptedupload = '@Model.HasAttemptedUpLoadNumeric';
      if (hasattemptedupload == 1) {
        var indexfirstinvalidfield = '@Model.GetIndexOfFirstInvalidField()';
        // focusIndexField(indexfirstinvalidfield);
        setTimeout(focusIndexField(indexfirstinvalidfield), 100);
      }
    }
  
    function focusIndexField(fieldindex) {
      var control = document.getElementById("field" + fieldindex);
      control.focus();
    }
  </code></pre>
  
  <p>In the code above, I have confirmed that the correct field is being referenced.  Everything appears to be as it should, except at the end of process, IE10 does not place the focus on the referenced field.  Why not and what would I have to do to make that happen?</p>