Jump to content

Link Inside Text Area


son

Recommended Posts

I have placed links inside a textarea, so user can right-click and easily copy/paste code. It does not validate and complains there should not be <a /> element in textarea. What could I do instead? Son
Well from reading your post you said "It does not validate and complains there should not be <a /> element in textarea." If you wrote your post correctly, then the browser is right, it shouldn't be their. Instead it should be written with a:
</a>

Don't put the "/" after the "a" put it before. Your link should look like

<a href:"http://www.example.com">Example</a>

Link to comment
Share on other sites

Well from reading your post you said "It does not validate and complains there should not be <a /> element in textarea." If you wrote your post correctly, then the browser is right, it shouldn't be their. Instead it should be written with a:
</a>

Don't put the "/" after the "a" put it before. Your link should look like

<a href:"http://www.example.com">Example</a>

"<a />" is just a shorthand representation for the full element with attributes and content. A textarea cannot contain HTML elements inside it, you can encode them with entities: <a />But maybe what you wanted was an actual link inside the textarea box. That's not possible. The textarea is only meant to have plain text in it.
Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...