473,498 Members | 1,721 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

createRange / createTextRange ?

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.crea teTextRange(
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.
Nov 18 '05 #1
0 1168

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
8929
by: Martin Karlsson | last post by:
Hi guys, Does anyone know how I can restore a selection created with createRange()? The problem is that I have a function that opens a new window with window.open() which of course makes the...
1
11830
by: Jeff Thies | last post by:
Is there a NS7, Opera7 or Mozilla equivalent for: document.selection.createRange(); Jeff
8
1987
by: lawrence | last post by:
I'm a beginner with Javascript and especially cross-browser Javascript. I got this working in IE, but not in Netscape 7. It seems like, in Netscape, every time I click on a button, the focus shifts...
15
3285
by: lawrence | last post by:
Is this the correct way to test for a method before I use it? createRange() is, I believe, an IE only method. function wrapSelectionInTag(selection, tag) { if (document.selection.createRange)...
3
8698
by: laredotornado | last post by:
Hi, I am trying to make some IE-only JScript work on Firefox and Safari. Does anyone know of equivalent methods for these functions? document.selection.createRange()...
2
1332
dmjpro
by: dmjpro | last post by:
i could do it by google. but it would be better to have a link from the experts. i m looking for a good link on obj.createTextRange plz send. kind regards.
3
3436
by: buss123 | last post by:
Hi all , we are getting the spellcheck suggestions from other JAR S(APPLET CODE ) . This application is working fine in IE but the same code is not working in Firefox. can any one...
5
10473
by: gsuns82 | last post by:
the following code works fine in IE6 but does not work in Mozilla,any idea to fix this cross browser issue??? Code PastedText = document.getElementById("hiddenText").createTextRange(); ...
5
13299
matheussousuke
by: matheussousuke | last post by:
Hello, I'm using tiny MCE plugin on my oscommerce and it is inserting my website URL when I use insert image function in the emails. The goal is: Make it send the email with the URL...
0
7125
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7002
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7165
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7205
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6887
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5462
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
3093
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3085
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
291
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.