Skip to main content
March 1, 2009
Question

SetFocus on first field

  • March 1, 2009
  • 1 reply
  • 1390 views
Hi

I have a cfform as follows:

<cfform action="" method="post" name="contactfrm" preloader="yes" format="flash"
height="300" width="500" skin="haloblue" timeout="30" onload="FName.setFocus()">

When the onload event runs the first input field has a blue glow around the edge of the box, but I can't find a way of making the cursor active in the field so that the user can start typing without having to click the mouse in the field first.

Can anybody help please.

Thanks.
Diane
    This topic has been closed for replies.

    1 reply

    Dileep_NR
    Inspiring
    June 29, 2009

    Hi,

    Please add this code at the bottom of your page
    <script type="text/javascript">   
          document.getElementById("FName").focus();    
      </script>