/    Sign up×
Community /Pin to ProfileBookmark

Change selected text in textarea

Hello, I have a form with a texarea. I would like to be able to modify text that has been selected/highlighted.
I know of the “Highlighted Text” code example ([url]http://javascript.internet.com/page-details/highlighted-text.html[/url]) which enables you to obtain the highlighted text and display it in another text box, but what I would like to be able to do is modify the selected/highlighted text. The purpose of this is to give my users the ability to select a word or group of words from a textarea, and convert the selection into a hyperlink without having to know html coding, but I don’t want to select the entire contents of the textarea.
As a mater of fact, this post form includes such a utility where you can create a hyperlink based on highlighted text, but I am only working with Javascript.

Hope someone can help,

Thanks

to post a comment
JavaScript

11 Comments(s)

Copy linkTweet thisAlerts:
@Khalid_AliAug 07.2005 — this question has been asked many times here on these forums, please do a quick search and u should get some responses
Copy linkTweet thisAlerts:
@Jonny_LangAug 08.2005 — Code deleted.
Copy linkTweet thisAlerts:
@magoSep 12.2005 — this question has been asked many times here on these forums, please do a quick search and u should get some responses[/QUOTE]

Jonny Lang, joe smith and others,

Did you manage to find any such threads? I'm also looking for some guidance on this matter.
Copy linkTweet thisAlerts:
@cyber1Sep 12.2005 — Jonny Lang, joe smith and others,

Did you manage to find any such threads? I'm also looking for some guidance on this matter.[/QUOTE]


try this:

[URL=http://www.neocoders.net/hypergen/]http://www.neocoders.net/hypergen/.[/URL]

-Bill
Copy linkTweet thisAlerts:
@magoSep 13.2005 — Hi Bill and thanks for the link.

Actually, I'm looking for something like this: [URL=http://www.neocoders.net/hyper/]http://www.neocoders.net/hyper/[/URL]

Also, it has to be a cross-browser solution. In other words, I need an editor that behaves like the one used here on Webdeveloper.com. Doesn't have to be as advanced though.

Best regards
Copy linkTweet thisAlerts:
@magoSep 14.2005 — Anyone?
Copy linkTweet thisAlerts:
@magoSep 19.2005 — I've been looking for a solution for weeks now and still nothing. Is it really so that this can't be done?
Copy linkTweet thisAlerts:
@prediOct 17.2005 — Here's the sollution. Just view source and copy to your WEB. It works just fine. ?

http://www.vladdy.net/demos/textareainsertion.html
Copy linkTweet thisAlerts:
@magoNov 09.2005 — Thank you, just what I was looking for!

Can't believe how short and concise Vladdy's code is, truely impressive!

Regards,
Copy linkTweet thisAlerts:
@joakim_boNov 14.2005 — A week ago I had the same problems as you guys, searching the web for somethin easy, free and usefull for hours- and I found this: http://tinymce.moxiecode.com/

Its totaly free, its well programmed, its pretty, and its WYSIWYG!

You have full posibilities to change apperance and functionality to fit your needs.

See standard examples here:

http://tinymce.moxiecode.com/example.php?example=true

In fact: its faster than the editor that's used on this forum :rolleyes:
×

Success!

Help @joe_smith spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.16,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @nearjob,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...