onFocus ?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Wm

    onFocus ?

    I'm trying to find how to set a form field so that when it's selected, all
    of the default/existing text in the field is highlighted and deleted when
    you start typing. As is, I have a default explanation of what's expected in
    a text box, and after clicking into the field they have to delete all of the
    explanation before they type. I'm guessing that a mouse-click into the text
    box can only place the cursor, and not "select all" as [might be] possible
    if someone tabs into the text box...?

    Wm



  • Jerry Park

    #2
    Re: onFocus ?

    Wm wrote:[color=blue]
    > I'm trying to find how to set a form field so that when it's selected, all
    > of the default/existing text in the field is highlighted and deleted when
    > you start typing. As is, I have a default explanation of what's expected in
    > a text box, and after clicking into the field they have to delete all of the
    > explanation before they type. I'm guessing that a mouse-click into the text
    > box can only place the cursor, and not "select all" as [might be] possible
    > if someone tabs into the text box...?
    >
    > Wm
    >
    >
    >[/color]
    onfocus="select ();"

    Comment

    • David Dorward

      #3
      Re: onFocus ?

      Wm wrote:
      [color=blue]
      > I'm trying to find how to set a form field so that when it's selected, all
      > of the default/existing text in the field is highlighted and deleted when
      > you start typing. As is, I have a default explanation of what's expected
      > in a text box, and after clicking into the field they have to delete all
      > of the explanation before they type. I'm guessing that a mouse-click into
      > the text box can only place the cursor, and not "select all" as [might be]
      > possible if someone tabs into the text box...?[/color]

      You might want to examine the code behind


      And note that the side effects might be considered harmful if the user
      wishes to return to a previous field to edit their answer slightly.

      --
      David Dorward http://dorward.me.uk/

      Comment

      Working...