title: how to set focus to first editable input element in form
body: <p>Dynamically created form contains input elements. First elements may be disabled or readonly.
  I tired code below to set focus to first elemnt which accepts data to enable fast data enttry form keyboard.
  However if form fist element is disable or readonly, focus is not set.
  How to set focus to  first element which accepts data ?</p>
  
  <pre><code>    &lt;form style='margin: 30px' id="Form" class='form-fields' method='post' target='_blank'
      action='Report/Render'&gt;
  ...
      &lt;input id='_submit' type='submit' value='Show report' class='button blue bigrounded' /&gt;
      &lt;/form&gt;
      &lt;script type="text/javascript"&gt;
          $(function () {
              var elements = $('#Form').find(':text,:radio,:checkbox,select,textarea');
              elements[0].focus();
              elements[0].select();
  });
  &lt;/script&gt;
  </code></pre>
  
  <p><strong>Update</strong></p>
  
  <p>There are also hidden input fields, sorry. Answers provided set focus to hidden element. Answr containing function does not find any element.ˇ</p>
  
  <p>Here is the update testcase:</p>
  
  <pre><code>$(function () {
    $("#form :input:not([readonly='readonly']):not([disabled='disabled'])").first() 
                                                                          .focus(); 
  });
  </code></pre>
  
  <p>How to set focus to vist visible, enabled and not readonly element ?</p>
  
  <p>Update 3 </p>
  
  <p>I tried Row W code where input element was added.
  Now it sets focus to second element. Testcase is shown at <a href="https://stackoverflow.com/revisions/8023512/5">Revision 5 of Rob W's answer</a></p>