Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > Finding the position of the cursor in a text box & Rich formated <textarea>

Reply
Thread Tools

Finding the position of the cursor in a text box & Rich formated <textarea>

 
 
Michael
Guest
Posts: n/a
 
      02-16-2006
Question 1
----------------
I am writing an advanced BBCode system for my forums and I would like
to be able to find where the cursor was positioned last in the text so
I could insert the BBCode there.

Question 2
----------------
Again I am writing an advanced BBCode system for my forums and I would
like to make is so that when someone puts in a [b] tag it goes bold, so
kind of a WYSIWYG editor and also for other things like [img] tags and
[url] tags. So could someone tell me how to do that. I would preferably
like it to still use the textarea tag, or at least a form component so
my existing code works.

 
Reply With Quote
 
 
 
 
VK
Guest
Posts: n/a
 
      02-16-2006

Michael wrote:
> Question 1
> ----------------
> I am writing an advanced BBCode system for my forums and I would like
> to be able to find where the cursor was positioned last in the text so
> I could insert the BBCode there.


Something like
<http://www.alexking.org/blog/2003/06/02/inserting-at-the-cursor-using-javascript/>

Cursor position in textarea is one of DOM model failures: evidently
needed, idiotically complicated to get.


> Question 2
> ----------------
> Again I am writing an advanced BBCode system for my forums and I would
> like to make is so that when someone puts in a [b] tag it goes bold, so
> kind of a WYSIWYG editor and also for other things like [img] tags and
> [url] tags. So could someone tell me how to do that. I would preferably
> like it to still use the textarea tag, or at least a form component so
> my existing code works.


Here's oopsy

Textarea has the atomic formatting: so you can apply any style but to
the entire textarea only. You need to use <div>, <iframe> etc.
JavaScript WYSIWYG editors of all quality and capabilities around the
Web, as it's one of preffered programming toys. I would suggest to look
for a suitable widget:
<http://www.google.com/search?hl=en&lr=&q=wysiwyg+editor+javascript&btnG= Search>

(Unless you are planning to use WYSIWYG programming to learn JavaScript
on your own)

 
Reply With Quote
 
 
 
 
Michael
Guest
Posts: n/a
 
      02-17-2006
Ok, thanks that helps. I will probably not bother with the WYSIWYG
editor for a little while because it will obviously need alot of work,
but I will implement the cursor position thing soon though.

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
how to tell if cursor is sqlite.Cursor or psycopg2.Cursor dmaziuk Python 3 01-25-2011 04:52 AM
How to check position of cursor blinking on text box Thriving K. Ruby 1 07-14-2009 04:22 AM
Convert UNIX formated text files to DOS formated? walterbyrd Python 13 05-13-2009 02:32 PM
How to get cursor insertion point (caret position) from text box DaveR ASP .Net 2 11-17-2004 09:39 AM
cursor position in text box AP Javascript 2 04-09-2004 09:38 PM



Advertisments