Welcome to WebmasterWorld Guest from 54.196.214.35

Forum Moderators: incrediBILL

Message Too Old, No Replies

Where to Open the Action URL since target attribute is deprecated

     
6:45 pm on Oct 10, 2010 (gmt 0)

Junior Member

5+ Year Member Top Contributors Of The Month

joined:Mar 1, 2010
posts: 194
votes: 0


Hi,

Please look at the following reference:
[w3schools.com ]

If the target attribute of <form> is deprecated, what's the right way to do it?


Thanks in advance!
Regards
Rain Lover
7:00 pm on Oct 10, 2010 (gmt 0)

Senior Member

WebmasterWorld Senior Member tedster is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:May 26, 2000
posts:37301
votes: 0


There might be some other way - but with HTML5 the target attribute is legitimate and the browser support for it is certainly fine.

If you need the page to validate, you can just change the DTD to <!DOCTYPE html> and you are future-proof, as far as I can see - unless your page depends on quirks mode, that is. The HTML5 DTD always triggers standards mode.
7:17 pm on Oct 10, 2010 (gmt 0)

Senior Member from CA 

WebmasterWorld Senior Member encyclo is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:Aug 31, 2003
posts:9063
votes: 2


the target attribute of <form> is deprecated


Well, it has been "undeprecated" (which is not a word, but describes best the situation!), so there is no real issue using target on a form tag. Don't hesitate to use it if you need it, browser support is universal.

It won't validate in HTML 4.01 Strict (or XHTML 1.0 Strict), but it will validate as HTML 4.01 Transitional (either in quirks or standards mode) as well as with HTML5.
3:49 pm on Oct 12, 2010 (gmt 0)

Senior Member

WebmasterWorld Senior Member rocknbil is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:Nov 28, 2004
posts:7999
votes: 0


Agreed, if you're not using XHTML features, a different doctype would likely better describe the content anyway. But if you absolutely must use an XHTML doctype, you can use Javascript as a substitute for the target attribute in forms and anchors/hyperlinks. It leads to another compromise, it's now Javascript dependent, but will validate.
12:19 pm on Oct 15, 2010 (gmt 0)

Junior Member

5+ Year Member Top Contributors Of The Month

joined:Mar 1, 2010
posts: 194
votes: 0


Dear tedster/encyclo/rocknbil,

Thanks for the answer! :-)
1:27 pm on Oct 15, 2010 (gmt 0)

Senior Member

WebmasterWorld Senior Member kaled is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:Mar 2, 2003
posts:3710
votes: 0


Validation is supposed to be helpful not a hindrance - just use the target attribute anyway.

As a matter of principle, you should never allow the decisions of stupid people to inconvenience you if you can avoid it. Everyone with more than two brain-cells to rub together knows that the target attribute is perfectly sensible - it's only been deprecated because a few brain-dead code-nazis managed to weasel their way into a position where they would wield a little power and annoy people.

Kaled.
12:26 pm on Oct 25, 2010 (gmt 0)

Full Member

5+ Year Member

joined:Dec 30, 2009
posts: 249
votes: 0


Good call Kaled, I couldn't have put it better.