These forums are currently read-only due to receiving more spam than actual discussion. Sorry.

It is currently Sat Dec 02, 2017 4:21 pm Advanced search

[solved] <form target="..."> non HTML 5 conf

Here you can discuss things related to HTML and the Web in general that do not fit in to other categories.

[solved] <form target="..."> non HTML 5 conf

Postby Le Sage » Wed Dec 05, 2007 9:17 pm

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.

:arrow: the incriminated webpage & the validation result (by the validator of Henri Sivonen).
Here seems to be the problem:
Code: Select all
<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! :D
Last edited by Le Sage on Thu Dec 13, 2007 10:46 am, edited 3 times in total.
User avatar
Le Sage
<h3>
 
Posts: 54
Joined: Wed Dec 05, 2007 9:08 pm
Location: Casablanca, Morocco

Postby anne » Thu Dec 06, 2007 7:26 pm

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.
User avatar
anne
<h4>
 
Posts: 32
Joined: Tue Feb 06, 2007 11:17 pm
Location: Utrecht, NL

Postby Le Sage » Fri Dec 07, 2007 12:32 pm

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. :)
User avatar
Le Sage
<h3>
 
Posts: 54
Joined: Wed Dec 05, 2007 9:08 pm
Location: Casablanca, Morocco

Postby anne » Sat Dec 08, 2007 9:50 pm

Hmm, it's not part of the DTD snippet. I guess it was only part of Transitional, not Strict.
User avatar
anne
<h4>
 
Posts: 32
Joined: Tue Feb 06, 2007 11:17 pm
Location: Utrecht, NL

Postby Le Sage » Sun Dec 09, 2007 11:57 am

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.
User avatar
Le Sage
<h3>
 
Posts: 54
Joined: Wed Dec 05, 2007 9:08 pm
Location: Casablanca, Morocco

Postby Le Sage » Sun Dec 09, 2007 6:19 pm

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)
User avatar
Le Sage
<h3>
 
Posts: 54
Joined: Wed Dec 05, 2007 9:08 pm
Location: Casablanca, Morocco

Postby Le Sage » Thu Dec 13, 2007 8:33 am

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. :)
User avatar
Le Sage
<h3>
 
Posts: 54
Joined: Wed Dec 05, 2007 9:08 pm
Location: Casablanca, Morocco

Postby zcorpan » Thu Dec 13, 2007 9:46 am

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.
zcorpan
<article>
 
Posts: 807
Joined: Tue Feb 06, 2007 8:29 pm
Location: Sweden

Postby Le Sage » Thu Dec 13, 2007 10:15 am

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
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
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? :roll:
User avatar
Le Sage
<h3>
 
Posts: 54
Joined: Wed Dec 05, 2007 9:08 pm
Location: Casablanca, Morocco

Postby zcorpan » Thu Dec 13, 2007 10:24 am

None of those quotes say that the target attribute is allowed. They are just UA requirements. You can't read UA requirements and draw conclusions about what authors are allowed to do. (Also see http://ln.hixie.ch/?start=1140242962&count=1 )

Again, the lack of <form target> is probably a spec bug and it is on the editors' radar.

http://lists.w3.org/Archives/Public/pub ... /0169.html
Last edited by zcorpan on Thu Dec 13, 2007 10:26 am, edited 1 time in total.
zcorpan
<article>
 
Posts: 807
Joined: Tue Feb 06, 2007 8:29 pm
Location: Sweden

Postby zcorpan » Thu Dec 13, 2007 10:25 am

Le Sage wrote:Does HTML4 mean strict, loose?

Strict (I think).
zcorpan
<article>
 
Posts: 807
Joined: Tue Feb 06, 2007 8:29 pm
Location: Sweden

Postby Le Sage » Thu Dec 13, 2007 10:46 am

I understand. Thanks for having reported the bug. Keep us in touch about this. :D
I mark the thread as solved.
User avatar
Le Sage
<h3>
 
Posts: 54
Joined: Wed Dec 05, 2007 9:08 pm
Location: Casablanca, Morocco


Return to General Discussion

Who is online

Users browsing this forum: No registered users and 1 guest