Jump to content

Recommended Posts

For some reason i cant seem to get this bit of code to validate and its really annoying me because i cant see a problem with it.

Maybe i need a fresh pair of eyes looking at it.

Here is is below

 

<textarea rows="3" cols="60"><a target="_blank" href="http://www.caravanineurope.co.uk">Caravan sites</a> A detailed description of caravan sites in Europe.</textarea>

 

This is what the validator says if it helps

 

Line 321, Column 39: there is no attribute "target".

<textarea rows="3" cols="60"><a target="_blank" href="http://www.caravanineurope✉

 

Line 321, Column 87: document type does not allow element "a" here.

…ef="http://www.caravanineurope.co.uk">Caravan sites</a> A detailed descriptio

 

thanks for all your help

 

Link to comment
https://forums.phpfreaks.com/topic/93075-how-to-make-this-xhtml-validate/
Share on other sites

Well the link would never show within a textarea, that's why you're getting validation errors.  the target="_blank" is no longer XHTML valid either, think about using onclick and calling Javascript, or maybe someone else knows a way :)

The only way it can be done keeping code valid is through javascript. That being said, the 'target' attribute was deprecated for a reason. It takes control out of the hands of the user, which goes against the policy if making the internet a usable place. Users should be able to decide if they want to open a new tab or window or what not. If they do, then they will. And if they don't they wont. If a user wants to return to the site they can use their back button.

 

Its kind of a hard concept to grasp for people who are used to using the target attribute - I had a hard time with it when I first found out. But over time I have come to not only understand the reasoning behind it, but also fully agree with it, and I get really annoyed now when I go to sites that open new tabs and windows without my asking for it.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.