Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Web Programming > JavaScript > BOOK: Beginning JavaScript
|
BOOK: Beginning JavaScript
This is the forum to discuss the Wrox book Beginning JavaScript by Paul Wilton; ISBN: 9780764544057
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning JavaScript section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old July 30th, 2004, 10:50 AM
Registered User
 
Join Date: Jul 2004
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Finding the cursors exact position?

Hi.

I've got a problem with a javascript I've created.
The script lets me write predefined text with a simple link. The problem is that the text written by the function writes the output to the end of the textarea. I want it to write exactly where the cursor is at the moment in that textarea. Is this possible at all with javascript?
Here's the code:

Code:
<html>
<head>
<script>

function Insert_Code(areaName,tag){
var Area = document.getElementById(areaName)
Area.innerText+=tag
}

</script>
</head>
<body>
<a onclick="Insert_Code('Test','<p>\n</p>')">Test<a><p>
<textarea id="Test"></textarea>

</body>
</html>
Hope someone knows how to do this.

Anders






Similar Threads
Thread Thread Starter Forum Replies Last Post
Get Data from Oracle cursors k_kosaraju ADO.NET 2 January 27th, 2009 11:38 AM
Maximum number of cursors exceeded. zaheerabbas.sk Oracle 1 July 4th, 2008 04:41 AM
MYSQL and Cursors paulkholt MySQL 1 September 8th, 2004 08:25 AM
Custom Cursors gp_mk Classic ASP Basics 0 May 29th, 2004 03:37 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.