Skip to main content
Known Participant
October 6, 2008
Question

Position Cursor

  • October 6, 2008
  • 2 replies
  • 475 views
Hi,
I am a newbie to CF. I have a form with a few input text boxes. How do I display the page so the cursor is positioned in the 1st text box? Is there an option in CFINPUT or CFFORM?
    This topic has been closed for replies.

    2 replies

    hefterrAuthor
    Known Participant
    October 6, 2008
    Dan,
    Thanks for the direction. For some reason, the only way I could get it to work was including it in the BODY tag (I found a web post) :
    <body onload="document.myform.mytextbox.focus()">

    Perhaps it's because I have other CF geberated Javascript for client side editing.

    Anyway, it works now. Thanks.
    Inspiring
    October 6, 2008
    You do it with javascript. This one works reasonably well for us:

    function setFocus()
    { document.forms[0].elements[0].focus(); }