javascript text box seletected text
-
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
-
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
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
-
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
will plz post exact code
-
will plz post exact code
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
-
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
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 :)