Tables in html5 |
Tables in html5 |
JimiB |
Feb 3 2015, 06:45 PM
Post
#1
|
Member Group: Members Posts: 49 Joined: 23-January 15 Member No.: 22,076 |
w3C is not validating my page anymore using html5 because of a table error.
I do hope someone can assist me on this. I have a contact form on a page but the errors are in the form fields. QUOTE Error Line 187, Column 44: Attribute for not allowed on element label at this point .The html within the form is CODE <tbody> <tr> <td class="c18"><label for="name">Name *</label></td> <td class="c18"><input class="contact_input" maxlength="50" name="name" size="30" type="text"></td> </tr> <tr> <td class="c18"><label for="email">Email *</label></td> <td class="c18"><input class="contact_input" maxlength="80" name="email" size="30" type="text"></td> </tr> <tr> <td class="c18"><label for="telephone">Telephone *</label></td> <td class="c18"><input class="contact_input" maxlength="30" name="telephone" size="30" type="text"></td> </tr> <tr> <td class="c18"><label for="comments">Message *</label></td> <td class="c18"> <textarea class="contact_textarea" cols="25" name="comments" rows="6"> |
Christian J |
Feb 3 2015, 07:27 PM
Post
#2
|
. Group: WDG Moderators Posts: 9,660 Joined: 10-August 06 Member No.: 7 |
The FOR attribute's value must match the ID value of the corresponding form field. See also http://www.htmlhelp.com/reference/html40/forms/label.html
|
pandy |
Feb 3 2015, 07:30 PM
Post
#3
|
🌟Computer says no🌟 Group: WDG Moderators Posts: 20,732 Joined: 9-August 06 Member No.: 6 |
It wouldn't validate as HTML 4.01 either.
|
JimiB |
Feb 3 2015, 08:03 PM
Post
#4
|
Member Group: Members Posts: 49 Joined: 23-January 15 Member No.: 22,076 |
It wouldn't validate as HTML 4.01 either. Ahem! i didnt QUOTE Errors found while checking this document as HTML5! Result: 4 Errors, 2 warning(s) Address: Encoding: utf-8 Doctype: HTML5 Root Element: html Both encoding and doctype were set to "detect automatically" This post has been edited by JimiB: Feb 3 2015, 08:05 PM |
pandy |
Feb 3 2015, 08:34 PM
Post
#5
|
🌟Computer says no🌟 Group: WDG Moderators Posts: 20,732 Joined: 9-August 06 Member No.: 6 |
I know you didn't. I was just poiting out that HTML5 isn't different from HTML 4.01 on this point. Your table wouldn't have validated under a HTML 4.01 doctype either. Maybe I misunderstod your post, that you thought it was a HTML5 issue.
|
JimiB |
Feb 3 2015, 08:35 PM
Post
#6
|
Member Group: Members Posts: 49 Joined: 23-January 15 Member No.: 22,076 |
The FOR attribute's value must match the ID value of the corresponding form field. See also http://www.htmlhelp.com/reference/html40/forms/label.html My apologies but, Am i missing something here? does name in the for, not go with the name in my form field posted above? QUOTE Error Line 187, Column 44: Attribute contact_input not allowed on element label at this point. <td class="c18"><label contact_input="name">Name *</label></td> Error Line 191, Column 35: The for attribute of the label element must refer to a form control. <td class="c18"><label for="email">Email *</label></td> Error Line 195, Column 39: The for attribute of the label element must refer to a form control. <td class="c18"><label for="telephone">Telephone *</label></td> Error Line 199, Column 38: The for attribute of the label element must refer to a form control. <td class="c18"><label for="comments">Message *</label></td> |
JimiB |
Feb 3 2015, 08:39 PM
Post
#7
|
Member Group: Members Posts: 49 Joined: 23-January 15 Member No.: 22,076 |
I know you didn't. I was just poiting out that HTML5 isn't different from HTML 4.01 on this point. Your table wouldn't have validated under a HTML 4.01 doctype either. Maybe I misunderstod your post, that you thought it was a HTML5 issue. But this page has been validating under xhtml for the past 3 years! |
pandy |
Feb 3 2015, 09:19 PM
Post
#8
|
🌟Computer says no🌟 Group: WDG Moderators Posts: 20,732 Joined: 9-August 06 Member No.: 6 |
Afraid I have to insist.
It can't have validated. The value of the for attribute associates the label with a form control with that id, not with that name. http://www.w3.org/TR/html401/interact/forms.html#h-17.9.1 See for yourself. http://www.htmlhelp.com/cgi-bin/validate.c...2Fhtml%3E%0D%0A Furthermore, the labels don't work the way you have it. The form control doesn't get focused when you click the label. Maybe there is a browser that lets this pass, but not that I've noticed. |
JimiB |
Feb 3 2015, 09:39 PM
Post
#9
|
Member Group: Members Posts: 49 Joined: 23-January 15 Member No.: 22,076 |
Afraid I have to insist. It can't have validated. I am so very sorry Pandy! I completely forgot that i changed the form to an updated version just before xmas. Please forgive me for doubting your better knowledge. I am finding keeping up with changes in html difficult and even harder to understand instructions based on a "supposedly know" basis. Ah! give me back my basic html anyday! ~I~t used to be fun to experiment and find alarming results! |
Christian J |
Feb 4 2015, 08:36 AM
Post
#10
|
. Group: WDG Moderators Posts: 9,660 Joined: 10-August 06 Member No.: 7 |
|
pandy |
Feb 4 2015, 09:38 AM
Post
#11
|
🌟Computer says no🌟 Group: WDG Moderators Posts: 20,732 Joined: 9-August 06 Member No.: 6 |
You are forgiven.
But stick to basic HTML then for now. It's not like HTML 4.01 has stopped working. |
JimiB |
Feb 5 2015, 09:14 AM
Post
#12
|
Member Group: Members Posts: 49 Joined: 23-January 15 Member No.: 22,076 |
|
Lo-Fi Version | Time is now: 26th April 2024 - 06:41 PM |