Where to Open the Action URL since target attribute is deprecated
Rain_Lover
6:45 pm on Oct 10, 2010 (gmt 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
tedster
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.
encyclo
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.
rocknbil
3:49 pm on Oct 12, 2010 (gmt 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.
Rain_Lover
12:19 pm on Oct 15, 2010 (gmt 0)
Dear tedster/encyclo/rocknbil,
Thanks for the answer! :-)
kaled
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.