 |
WHATWG HTML5 Forums A Forum for HTML5 Discussions: Semantics, DOM APIs, Microdata, Canvas, WebGL, Offline Web Applications, Local Storage, WebM Video, WebSockets, Web Workers, HTML5 Drag and Drop, HTML5 Forms, Accessibility, Syntax, News, Keywords, Yet More Keywords & More.
|
| View previous topic :: View next topic |
| Author |
Message |
Le Sage <h4>

Joined: 05 Dec 2007 Posts: 54 Location: Casablanca, Morocco
|
Posted: Wed Dec 05, 2007 9:17 pm Post subject: [solved] <form target="..."> non HTML 5 conf |
|
|
Hey all!
That's my first post here, so I hope I don't make any mistake. My name is Le Sage, & I'm the webmaster of the little html5.fr & its blog.
The main page of html5.fr is supposed to be HTML 5, but I recently added a search bar using Google, & it stopped validating for the following reason:
| html5.validator.nu wrote: | | Error: Attribute target not allowed on element form at this point. |
the incriminated webpage & the validation result (by the validator of Henri Sivonen).
Here seems to be the problem:
| Code: | <form method="get" action="http://www.google.fr/search" target="_blank">
...
</form> |
The target attribute doesn't seem to be welcome here. Though, I had a look at the HTML 4.01 & Web Forms 2.0 specs & didn't see anything that would forbid this.
Any idea where it would come from?
If it's not the appropriate place for such a question, please forgive me. If you need any detail, I'm here to answer.
Thanks in advance! 
Last edited by Le Sage on Thu Dec 13, 2007 10:46 am; edited 3 times in total |
|
| Back to top |
|
 |
anne <h5>

Joined: 06 Feb 2007 Posts: 32 Location: Sometimes Utrecht, NL
|
Posted: Thu Dec 06, 2007 7:26 pm Post subject: |
|
|
| It seems that HTML4 did not allow target= and HTML5 does (by means of Web Forms 2.0) and that indeed, validator.nu has a bug. |
|
| Back to top |
|
 |
Le Sage <h4>

Joined: 05 Dec 2007 Posts: 54 Location: Casablanca, Morocco
|
Posted: Fri Dec 07, 2007 12:32 pm Post subject: |
|
|
HTML 4.01 didn't? I was something on the HTML 4.01 specs - form element:
| HTML 4.01 specs - form element wrote: | Attributes defined elsewhere
* id, class (document-wide identifiers)
* lang (language information), dir (text direction)
* style (inline style information)
* title (element title)
* target (target frame information)
[...] |
Doesn't it mean that it's valid? BTW, it's taken into account by FF & IE (probably by others too, didn't check).
Here is for the Web forms 2.0 specs - form element.
So if it's a bug, I guess I should contact the validator's author. I'll do it soon.
Thanks for your help, Anne.  |
|
| Back to top |
|
 |
anne <h5>

Joined: 06 Feb 2007 Posts: 32 Location: Sometimes Utrecht, NL
|
Posted: Sat Dec 08, 2007 9:50 pm Post subject: |
|
|
| Hmm, it's not part of the DTD snippet. I guess it was only part of Transitional, not Strict. |
|
| Back to top |
|
 |
Le Sage <h4>

Joined: 05 Dec 2007 Posts: 54 Location: Casablanca, Morocco
|
Posted: Sun Dec 09, 2007 11:57 am Post subject: |
|
|
Just checked, that's right; <from target="..." ... is allowed in transitional, but not in strict HTML 4.01 (which makes sense, if you compare it to normal <a href="..." ... links).
I haven't mailed the validator's author yet, but I'll do it soon.
Thanks again for your comments, Anne. |
|
| Back to top |
|
 |
Le Sage <h4>

Joined: 05 Dec 2007 Posts: 54 Location: Casablanca, Morocco
|
Posted: Sun Dec 09, 2007 6:19 pm Post subject: |
|
|
mail just sent
I hope my problem isn't already listed in the know issues (had a quick look at it, but didn't find it) |
|
| Back to top |
|
 |
Le Sage <h4>

Joined: 05 Dec 2007 Posts: 54 Location: Casablanca, Morocco
|
Posted: Thu Dec 13, 2007 8:33 am Post subject: |
|
|
I got an answer from Henri Sivonen; he corrected his rules according to this thread. However, he doesn't see where it's stated that form may contain target in WF2. I thought this link was enough to proove it:
| WF2 specs wrote: |
interface HTMLFormElement : HTMLElement {
...
attribute DOMString target;
...
};
|
May anyone confirm?
I don't see form associated with target in the HTML5 Elements and Attributes list by Simon Pieters (zcorpan on this forum), so I'm confused now. Did I misread the specs?
Thanks to everyone for your help anyway, I'll post another problem with HTML entities in XHTML 5 soon.  |
|
| Back to top |
|
 |
zcorpan <h1>
Joined: 06 Feb 2007 Posts: 436 Location: Sweden
|
Posted: Thu Dec 13, 2007 9:46 am Post subject: |
|
|
AFAICT, WF2 doesn't allow the target="" attribute. This is probably a bug in the spec.
The presence of the DOM attribute, and the fact that it reflects the content attribute, doesn't in and of itself make target="" allowed. It just says what UAs have to do. |
|
| Back to top |
|
 |
Le Sage <h4>

Joined: 05 Dec 2007 Posts: 54 Location: Casablanca, Morocco
|
Posted: Thu Dec 13, 2007 10:15 am Post subject: |
|
|
My English is very poor, but...
Web Forms 2.0 specs, 2.16. Extensions to the form element:
| Web Forms 2.0 specs wrote: |
To support incremental updates of forms, a new attribute is introduced on the form element: replace. This attribute takes two values:
document
The default value. The entire document (as specified by the target attribute when the document uses frames or windows) is replaced by the return value. |
Web Forms 2.0 specs, 5. Form submission, 8. Step eight: Handle the returned data:
| Web Forms 2.0 specs wrote: |
If the response is an HTTP 205 Reset Content response (or equivalent for other protocols), then the document in the frame or window targeted by the form submission is left in place[...]
For replace="document" (the default), the response body replaces the document from which the submission initiated (or, if there is a target attribute, the document in the appropriate frame or window).
|
If it's written somewhere in the specs that WF2 doesn't allow the target="" attribute, I guess it should be written more clearly, 'cause I didn't see it anywhere. (no irony, I'm not so good in reading specs)
ADD: in the WF2 specs, appendix A. XHTML module definition, there is no trace of the target attribute in the form element. Though, it's written
| Quote: | | The Web Forms 2.0 Module provides all of the forms features found in HTML4, plus the extensions described above. |
Does HTML4 mean strict, loose?
Anyway, it also says
| Quote: | | When frames and multiple windows are also allowed, the target attribute is added to the form, input and button elements. |
Does it close the debate according to you?  |
|
| Back to top |
|
 |
zcorpan <h1>
Joined: 06 Feb 2007 Posts: 436 Location: Sweden
|
|
| Back to top |
|
 |
zcorpan <h1>
Joined: 06 Feb 2007 Posts: 436 Location: Sweden
|
Posted: Thu Dec 13, 2007 10:25 am Post subject: |
|
|
| Le Sage wrote: | | Does HTML4 mean strict, loose? |
Strict (I think). |
|
| Back to top |
|
 |
Le Sage <h4>

Joined: 05 Dec 2007 Posts: 54 Location: Casablanca, Morocco
|
Posted: Thu Dec 13, 2007 10:46 am Post subject: |
|
|
I understand. Thanks for having reported the bug. Keep us in touch about this.
I mark the thread as solved. |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|