0 Replies Latest reply on Jul 24, 2012 2:22 AM by Klaus Heim

    Set focus to input field (RhoElements V2.x)

    Klaus Heim

      With RhoElements V1.0.2.3 or V1.0.3.11 the following code snippets set the focus to the input field, but with the newest Version V2.0.5.27 (WM on a Motorola MC55) not. Any suggestion how to set the focus to an input field?

       

      Snippet 1:

      <form action="#">
             <div style="padding:10px">
                <span class="label">Label: </span>
                <input id="test" type="text" value="" placeholder="placeholder" autofocus="">
                <input type="submit" value="Go">
             </div>
      </form>

       

      Snippet 2:

       

      <script type="text/javascript">
          window.onload = function() {
             id=document.getElementById('test');
             if(id) {
                id.focus();
             }
          }
      </script>
      <form action="#">
          <div style="padding:10px">
              <span class="label">Label: </span>
              <input id="test" type="text" value="" placeholder="placeholder" >
              <input type="submit" value="Go">
          </div>
      </form>