473,799 Members | 3,276 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Putting a cusor in normal text

Hi all you JS experts,
Is there any way to put a blinking ibeam cursor in middle of td text -
the same way it would blink if I clicked in the middle of the text in a
text input? To further explain, I can highlight any text on an HTML
page by dragging, but if I just click I get no ibeam cursor (obviously
because I am not supposed to be able to edit). Is there anyway to get
one to sit there and blink where-ever I click on the page.
Thanks for your help
Pachydermitis

Jul 26 '05 #1
6 3315
VK
de******@hotmai l.com wrote:
Hi all you JS experts,
Is there any way to put a blinking ibeam cursor in middle of td text -
the same way it would blink if I clicked in the middle of the text in a
text input? To further explain, I can highlight any text on an HTML
page by dragging, but if I just click I get no ibeam cursor (obviously
because I am not supposed to be able to edit). Is there anyway to get
one to sit there and blink where-ever I click on the page.
Thanks for your help
Pachydermitis


You can set it very easy for IE by using contenteditable attribute
(note that you cannot set table cell itself to contenteditable , so you
need a div wrapper).

<html>
<head>
<title>contentE ditable</title>
<meta http-equiv="Content-Type" content="text/html;
charset=iso-8859-1">
<style type="text/css">
body { background-color: #FFFFFF}
td div { font: 10pt Verdana, Helvetica, sans-serif; height: auto;
width: 100%}
</style>
</head>
<body>
<table width="75%" cellpadding="10 " cellspacing="0" border="1">
<tbody>
<tr>
<td width="33%"><di v contenteditable ="true">empt y</div></td>
<td width="34%"><di v contenteditable ="true">empt y</div></td>
<td width="33%"><di v contenteditable ="true">empt y</div></td>
</tr>
<tr>
<td><div contenteditable ="true">empt y</div></td>
<td><div contenteditable ="true">Lore m ipsum dolor sit amet,
consectetuer
adipiscing elit. Phasellus in sem lacinia nunc rutrum tempor. Vivamus
facilisis.
Vivamus lectus eros, aliquet id, tincidunt in, tempus quis, erat. Etiam
scelerisque
sem et massa. Cum sociis natoque penatibus et magnis dis parturient
montes, nascetur
ridiculus mus. Ut at arcu. Praesent et turpis ac urna ornare hendrerit.
Mauris
vitae pede a libero scelerisque egestas. Nunc sollicitudin, orci et
commodo ultrices,
nisl libero vulputate urna, in posuere ligula arcu ut libero. In
ullamcorper neque
ut mi.</div></td>
<td><div contenteditable ="true">empt y</div></td>
</tr>
<tr>
<td><div contenteditable ="true">empt y</div></td>
<td><div contenteditable ="true">empt y</div></td>
<td><div contenteditable ="true">empt y</div></td>
</tr>
</tbody>
</table>
</body>
</html>

I guess you can emulate this on Firefox using document.design Mode
property.

Opera and Safary (at least) do not have the necessary TextRange
methods. So you can get the selection using document.getSel ection(),
but you cannot reliably attach it to the particular place in the
document (find the corresponding DOM block).

Jul 26 '05 #2
- Hope this isn't a repeat post the first died -
VK you're awesome - this works even better than I had hoped - with much
less work on my part.
Lorem ipsum threw me for a minute; I knew it looked familiar, thought
it was Latin, and looked it up . . duh do I feel like an uneducated
clod. :)
Thanks for the help
Pachydermitis

Jul 26 '05 #3
VK
Pachydermitis wrote:
- Hope this isn't a repeat post the first died -
VK you're awesome - this works even better than I had hoped - with much
less work on my part.
Lorem ipsum threw me for a minute; I knew it looked familiar, thought
it was Latin, and looked it up . . duh do I feel like an uneducated
clod. :)
Thanks for the help
Pachydermitis


"Lorem ipsum" is the standard bogus text to use as placeholder. It's a
"pseudo-Latin" - composed of Latin words but means nothing. I hope you
did try to translate it! :-)

Jul 26 '05 #4
VK wrote:
de******@hotmai l.com wrote:
Hi all you JS experts,
Is there any way to put a blinking ibeam cursor in middle of td text -


You can set it very easy for IE by using contenteditable attribute


Do you happen to know if something like that is possible for
Mozilla/Firefox?
Jul 28 '05 #5
Robert wrote:
VK wrote:
de******@hotmai l.com wrote:
Hi all you JS experts,
Is there any way to put a blinking ibeam cursor in middle of td text -

You can set it very easy for IE by using contenteditable attribute

Do you happen to know if something like that is possible for
Mozilla/Firefox?


<URL:http://www.mozilla.org/editor/ie2midas.html>

--
Rob
Jul 28 '05 #6
Yes - the fact that it is the standard bogus placeholder text for
typesetting came painfully back to memory - after I tried to translate
it. :)

Aug 3 '05 #7

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

Similar topics

8
2218
by: Markus Franz | last post by:
Hi. I used urllib2 to load a html-document through http. But my problem is: The loaded contents are returned as binary data, that means that every character is displayed like lÀÃt, for example. How can I get the contents as normal text? My script was:
7
3442
by: Lachlan Hunt | last post by:
Hi, I have recently downloaded and experemented with IBM HPR 3.0, and Opera 8 with text-to-speech, and have come to realise some fairly annoying issues regarding punctuation marks. I've found, that when a punctuation mark occurs directly after an element, both HPR and Opera 8 will read the punctuation mark. For example, the following: <p><abbr title="...">HTML</abbr> is an application of
11
19620
by: Yeah | last post by:
I have a multiple choice quiz where I would like to use CSS to change the color of the answers upon clicking them. I would like to present the right and wrong answers up front, rather than direct the user to a separate page with all correct answers. Do the answers have to be "links" for this to work? They have to be inactive links, because they don't actually go anywhere. They only serve the purpose of changing color whether they're...
0
1394
by: TadPole | last post by:
I am using FOP to create PDF documents. I have the problem where I need to create line of text on a document in a certain line (absolute position), then the rest of the text needs to follow after that fixed line of text. What I am getting is the fixed line of text starting at the correct place, but then the rest of the text is then starting at the top of the document.
15
3914
by: phillip.s.powell | last post by:
<style> div div table tr td a.navbar, div div table tr td font {display: none;} </style> <div class="navigationbar" style="background-color:Black; position: absolute; left:50%; top:127px; margin-left: -400px; width: 800px; height: 26px"> <!-- CODE GOES HERE --> </div>
0
2342
by: mephraim | last post by:
I have a page at (view in IE): http://rmc2.dev.leepfrog.com/ie_fix_me/index.html that has an image floated right outside of a main content div that looks like: <img src="blah" style="float: right; clear: right;> <div class="schoolofcenter">
1
1123
by: maflatoun | last post by:
Hi, I'm using the asp:TreeView component of asp.net 2.0 and my tree is structure is Root -- Parent 1 --------- Leaf 1 --------- Leaf 2
1
1673
by: coldbuttmoneky | last post by:
Now i know that clearing a text field in normal macromedia flash is a simple: textfield.text=""; but when this is place into a button on selteco flash, it doesnt seem to clear anything. The name of my text field is search so i thought putting: search.text=""; but it displays an error message. someone help? bad action cript person here needing soome help on selteco. lol.
6
2376
by: acorna | last post by:
Hi All This may seem like a stupid question but I can't get my text to left align. It used to but it's now decided to centre and I can't see why. I have include the css and the relevant table code. If one of you can spot the problem I would appreciate it. The table "top info box" is within the table "main". The page can be seen at it's temporary home here. http://mariehines.co.uk/NEW/home.php Regards
0
9687
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10251
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10228
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10027
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9072
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7565
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
1
4141
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3759
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2938
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.