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.
Who is Participating?
biztigerConnect With a Mentor Commented:
Check this out

Use prompt to take the url from the user

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

As they are open source you can look at their code also, to find your solution. The most simplistic action you will find at:
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 .  There is also some good info on more at .  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 .
Let me know if you have a question about any of this or need more info.
All Courses

From novice to tech pro — start learning today.