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.
<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.