Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    Regular Coder
    Join Date
    Jul 2003
    Location
    NJ - #29 if you must know
    Posts
    117
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Pre "HIGHLIGHT"ing in a TEXT FIELD??

    What I am doing, is if you click on a drop down list,
    the first selection is "--NOT IN LIST--", I have an
    OnBlur routine that checks the value of the select
    list for the above.

    If it is "Not in list", it hides the drop down list, then
    unhides a text box that will allow you to type in
    the Entry that is not in the list.

    I am currently filling the text with "Enter .... Here",

    All works great.

    Except....you have to highlight the "Enter...Here" first
    and either start typing or hit <del> then type.

    Is there a way to make the text already highlighted,
    so once the user types the first character, the
    "Enter....Here" disappears?

    Or, am I going to have to use a OnKeyDown() routine to
    do this?

    George

  • #2
    Senior Coder
    Join Date
    Jun 2002
    Location
    ColoRockyz
    Posts
    1,649
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Try this for your textbox:
    <input type="text" onfocus="this.value='';" value="Start here">
    Zoobie or not Zoobie...That is the problem.
    <body onUnload="flush( ! )">

  • #3
    Banned
    Join Date
    Sep 2003
    Posts
    3,620
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I think your looking for focus() and select()

    <form name="WordForm">
    <input type="text" size="100" onMouseover="focus();select()" value="Test focus, select">
    </form>

    .....Willy

  • #4
    Regular Coder
    Join Date
    Jul 2003
    Location
    NJ - #29 if you must know
    Posts
    117
    Thanks
    0
    Thanked 0 Times in 0 Posts
    YES. select() is what I wanted.

    Thank you.

    I've seen it used before, but never realized what
    it did. I thought it was just a cross browser of
    focus().

    George


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •