createRange / createTextRange ?

G

Guest

First what I want to accomplish. I have implemented a "Find" into a TextArea but I want the user to be able to reposition the "Find" start point by clicking into the TextArea. I am using Visual Studio as a development platform running ASP.Net with VB codebehind. Here is some code

<HTML><HEAD
..
<script><!-
var tr
function JustLoaded(

tr = AdministratorStatusReportSummaryForm.Summary1.createTextRange(


function FindText(

if (tr.findText("No Status")

tr.select(
tr.scrollIntoView(
tr.collapse(false

els

alert("Did not find text"



function oc(

if (document.selection.type == "Text"

temptr = document.selection.createRange


--></script></HEAD><body onload="JustLoaded()" scroll="auto"><form id="AdministratorStatusReportSummaryForm" runat="server"
..
<TextArea id="Summary1" runat="server" style="WIDTH: 90%" rows="25" onmouseup="oc()" /><input id="btnFind" type="button" value="Find" onclick="FindText()"
..
</form></body></HTML

My problem is the following: In the TextArea it will allow me to createTextRange but not allow me to createRange. With docmument.selection it will allow me to createRange but not allow me to createTextRange. So how do I get "tr" to search starting at the new insertion point.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,767
Messages
2,569,570
Members
45,045
Latest member
DRCM

Latest Threads

Top