FreeTextBox

The no. 1 free ASP.NET HTML Editor.
Welcome to FreeTextBox Sign in | Join | Help
in Search

how to prevent on load focus??

Last post 07-25-2008, 12:09 AM by rbt0222. 2 replies.
Sort Posts: Previous Next
  •  02-07-2007, 11:23 PM 7902

    how to prevent on load focus??

    Hi,

    I have a long page that I used freetextbox on the bottom of it , the problem is when the page load it jumps straight to end of it because  of FTB focus. I have set Focus="false"  but it doesn’t help.

  •  03-26-2007, 4:39 AM 8063 in reply to 7902

    Re: how to prevent on load focus??

    i have an unneatly way to solve this problem.

    i put an input textbox at the top of my <form>, and name it like "my_focusTextBox".

    here is the code:

    <input type="text" name="my_focusTextBox">

    then I wrote these javascript just below "my_focusTextBox"

    <script language="javascript">
    document.getElementById("my_focusTextBox").focus();
    document.getElementById("my_focusTextBox").style.display="none";
    </script>

    When the page is loaded, "my_focusTextBox" will first be set focus, not the FTB. this prevent the page from scrolling to the bottom.

    I hope this will help you.

  •  07-25-2008, 12:09 AM 9312 in reply to 8063

    Re: how to prevent on load focus??

    Yo!  This ricks.  You da man.

    I can't believe this minor issue exists.  Thanks.

View as RSS news feed in XML
www.freetextbox.com