Solved

insert hypertext link in a textarea

Posted on 2003-11-14
10
848 Views
Last Modified: 2013-11-19
I need to insert a hypertext link in a textarea and when the link is selected the relevant url is opened in a new window.
0
Comment
Question by:oracle68
10 Comments
 
LVL 10

Accepted Solution

by:
Bustarooms earned 50 total points
ID: 9748072
let me ask you this... is it absolutely necessary for it to be a textarea?  meaning, will you be submitting these URLs via a form???

can it just look like a textarea

<html>
<head>
<style>
div#txtArea{
    border: 2px inset #cccccc;
    overflow-y: scroll;
    width: 372px;
    height: 160px;
padding:2px;
   
FONT-WEIGHT: normal; FONT-SIZE: 11px; COLOR: #000000; FONT-FAMILY: arial, helvetica, sans-serif
}
</style>
</head>
<body>
<div id="txtArea">
<a href="http://www.google.com" target="_blank">Google</a><br>
<a href="http://www.yahoo.com" target="_blank">Yahoo</a><br>
<a href="http://www.experts-exchange.com" target="_blank">Experts Exchange</a>
</div>
</body>
</html>
0
 

Author Comment

by:oracle68
ID: 9748194
yes it has to be a textarea as the URLwill be submitted with the rest of the data on the HTML form.
0
 
LVL 10

Expert Comment

by:Bustarooms
ID: 9748236
is the textarea editable?
0
Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

 
LVL 8

Expert Comment

by:klykken
ID: 9748301
bustarooms,
just a quick question regarding your example;
Is overflow-y standards compliant? Which browsers can oracle68 expect this to work in?

-klykken
0
 

Author Comment

by:oracle68
ID: 9748400
Bustarooms,

The textarea is readonly after the form has been initiated.
0
 
LVL 10

Expert Comment

by:Bustarooms
ID: 9748560
klykken
it will work for M$ only.  

an alternative is overflow: scroll;  however, this will add scrollbars to both vert and horz

you could also use overflow: auto; which will only put the bars on when necessary
0
 
LVL 11

Assisted Solution

by:Zontar
Zontar earned 50 total points
ID: 9752252
You can't put a hyperlink inside a textarea. If you need to submit the URL as part of a form, then put it in a hidden field in the form.
0
 
LVL 1

Expert Comment

by:cifroes
ID: 9775318
simple: you can't.
0

Featured Post

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
This article describes how to create custom column layout styles for Bootstrap. The article uses 5 columns to illustrate the concept, but the principle can be extended to any number of columns.
In this tutorial viewers will learn how to style elements, such a divs, with a "drop shadow" effect using the CSS box-shadow property Start with a normal styled element, such as a div.: In the element's style, type the box shadow property: "box-shad…
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…

786 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question