Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. Cursor can not move through all the characters within textbox after textbox.select()

Cursor can not move through all the characters within textbox after textbox.select()

Scheduled Pinned Locked Moved Web Development
javascripthelp
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    AshishTijare
    wrote on last edited by
    #1

    I want to highlight text in textbox on focus of it. I have called textbox.select(). The problem after execution of textbox.select() is, cursor can only move to begining of the text or to the end of text in textbox. It is not going through the characters which are in the middle. Cursor directly jump to begining or end character in the textbox when moved. Can somebody suggest the solution over this (I am doing all this stuff in javascript, so javascript solution is most welcome). Thank you.

    Ashish Software Engineer, Pune

    S 1 Reply Last reply
    0
    • A AshishTijare

      I want to highlight text in textbox on focus of it. I have called textbox.select(). The problem after execution of textbox.select() is, cursor can only move to begining of the text or to the end of text in textbox. It is not going through the characters which are in the middle. Cursor directly jump to begining or end character in the textbox when moved. Can somebody suggest the solution over this (I am doing all this stuff in javascript, so javascript solution is most welcome). Thank you.

      Ashish Software Engineer, Pune

      S Offline
      S Offline
      Shog9 0
      wrote on last edited by
      #2

      I take it then that you do not actually wish the text in the textbox to be selected, as the behavior of the cursor with regard to selected text is plaform- and browser- dependant. So just change the background and text color of the textbox:

      var textbox = document.getElementById("textbox");
      textbox.style.backgroundColor = "blue";
      textbox.style.color = "white";

      ...etc.

      ----

      You're right. These facts that you've laid out totally contradict the wild ramblings that I pulled off the back of cornflakes packets.

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups