Can a user add a link to a text area by clicking a button?

I have a form which updates to my database. I want to give the user the option to turn something into a link by highlighting the text and then clicking a button which will open a new window where they type the link address. When they close the window the highlighted text should be turned into a link. An example is Yahoo mail or most other mail programs where you turn text into a link. Can anyone either explain how I do this or point me in the right direction? Thanks.
LVL 4
elliottbenzleAsked:
Who is Participating?
 
biztigerConnect With a Mentor Commented:
Check this out
http://www.webxpertz.net/forums/showthread.php?s=&threadid=15883&highlight=textarea
and
http://www.tek-tips.com/viewthread.cfm?qid=1115976&page=3

Use prompt to take the url from the user

Also you can try other popular wysiwyg editor such as tinymce and fckeditor.

http://tinymce.moxiecode.com/
http://www.fckeditor.net/

As they are open source you can look at their code also, to find your solution. The most simplistic action you will find at:
http://livepipe.net/control/textarea
0
 
GawaiCommented:
0
 
b0lsc0ttIT ManagerCommented:
In case it isn't obvious from the posts above you need to use something else to do it.  A textarea tag can't do this.  With script you might get selected text and even modify it but the textarea can't show a hyperlink; it is just basic text.
There area a number of suggestions above for replacements that will do it.  There are even more available.  Another good one is at http://www.textarearich.com/ .  There is also some good info on more at http://www.htmlarea.com .  The one at the bottom of the page is an old, good, reliable one.  If you want to see a search result with a number of others you can look at http://www.google.com/search?num=100&hl=en&safe=off&q=rich+textarea&btnG=Search .
Let me know if you have a question about any of this or need more info.
bol
0
All Courses

From novice to tech pro — start learning today.