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)
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)
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)
12:19 pm on Oct 15, 2010 (gmt 0)
Thanks for the answer! :-)
1:27 pm on Oct 15, 2010 (gmt 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.