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. ASP.NET
  4. javascript text box seletected text

javascript text box seletected text

Scheduled Pinned Locked Moved ASP.NET
javajavascripttoolsquestion
5 Posts 3 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.
  • N Offline
    N Offline
    nikhil1234
    wrote on last edited by
    #1

    i want to replace seleted text in text box using java script so i have written function document.selection.createRange().text = mytext; but if another text seleted on the page and if click button then that text also gets replaced how do i check text from text box is seleted

    C S 2 Replies Last reply
    0
    • N nikhil1234

      i want to replace seleted text in text box using java script so i have written function document.selection.createRange().text = mytext; but if another text seleted on the page and if click button then that text also gets replaced how do i check text from text box is seleted

      C Offline
      C Offline
      Christian Graus
      wrote on last edited by
      #2

      document.getElementById("clientsideId").selection.etc call the ClientID method of your control to get the client side id

      Christian Graus Driven to the arms of OSX by Vista. "! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums. I can do things with my brain that I can't even google. I can flex the front part of my brain instantly anytime I want. It can be exhausting and it even causes me vision problems for some reason. - CaptainSeeSharp

      N 1 Reply Last reply
      0
      • C Christian Graus

        document.getElementById("clientsideId").selection.etc call the ClientID method of your control to get the client side id

        Christian Graus Driven to the arms of OSX by Vista. "! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums. I can do things with my brain that I can't even google. I can flex the front part of my brain instantly anytime I want. It can be exhausting and it even causes me vision problems for some reason. - CaptainSeeSharp

        N Offline
        N Offline
        nikhil1234
        wrote on last edited by
        #3

        will plz post exact code

        C 1 Reply Last reply
        0
        • N nikhil1234

          will plz post exact code

          C Offline
          C Offline
          Christian Graus
          wrote on last edited by
          #4

          I really can't without knowing more about your page. I do prefer to help people become programmers tho, which is better done by telling you enough that if you can't write the code, you shouldn't be asking the question

          Christian Graus Driven to the arms of OSX by Vista. "! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums. I can do things with my brain that I can't even google. I can flex the front part of my brain instantly anytime I want. It can be exhausting and it even causes me vision problems for some reason. - CaptainSeeSharp

          1 Reply Last reply
          0
          • N nikhil1234

            i want to replace seleted text in text box using java script so i have written function document.selection.createRange().text = mytext; but if another text seleted on the page and if click button then that text also gets replaced how do i check text from text box is seleted

            S Offline
            S Offline
            satigar123
            wrote on last edited by
            #5

            a small change javascript which u written is correct that's great document.getElementById('textboxid').focus() document.selection.createRange().text = mytext i hope it will work byee :)

            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