Jump to content

Problem with adding tags into INPUT TEXTAREA


POGRAN

Recommended Posts

I'm writing some forum that is going to use almost the same advantages while writing/editing a new topic (Bold text tag adding function, image adding function etc) as this forum does.

Only one problem to which I didn't succeed to find decision is how to input the tags exactly in that line where cursor is flashing and not in the end of text..

I hope somebody knows decision!
Thanks in advance and bye for now..
Link to comment
Share on other sites

Hi,,

just posted that one:
[a href=\"http://www.phpfreaks.com/forums/index.php?showtopic=93345\" target=\"_blank\"]cursor position in a textarea[/a],, :)
The script works with both IE & FF,,
just,... with IE, the script needs to add a "no-sense key" to find the correct cursor position,... & then, once the bbcode is added, it removes the "no-sense key",... (tested with IE, "ctrl+Z" displays the 'no-sense key',,, erff,....)
with firefox, it was easier (as often,,, :p ), using the 'setSelectionRange' method,

Hoping it helps,,

l8tr,,
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.