<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://www.w3.org/Bugs/Public/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4"
          urlbase="https://www.w3.org/Bugs/Public/"
          
          maintainer="sysbot+bugzilla@w3.org"
>

    <bug>
          <bug_id>10146</bug_id>
          
          <creation_ts>2010-07-13 16:51:36 +0000</creation_ts>
          <short_desc>Labelability of hidden form inputs unclear</short_desc>
          <delta_ts>2010-10-04 14:48:33 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>HTML WG</product>
          <component>pre-LC1 HTML5 spec (editor: Ian Hickson)</component>
          <version>unspecified</version>
          <rep_platform>All</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>CLOSED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P3</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Erik Rose">erik</reporter>
          <assigned_to name="Ian &apos;Hixie&apos; Hickson">ian</assigned_to>
          <cc>ian</cc>
    
    <cc>mike</cc>
    
    <cc>public-html-admin</cc>
    
    <cc>public-html-wg-issue-tracking</cc>
          
          <qa_contact name="HTML WG Bugzilla archive list">public-html-bugzilla</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>36797</commentid>
    <comment_count>0</comment_count>
    <who name="Erik Rose">erik</who>
    <bug_when>2010-07-13 16:51:36 +0000</bug_when>
    <thetext>When labeling a hidden input element in an HTML 5 document, the validator at http://validator.w3.org/check returns the following error: &quot;The for attribute of the label element must refer to a form control.&quot; Further discussion with the good folks who maintain the validator (http://bugzilla.validator.nu/show_bug.cgi?id=755), spilling over into the IRC exchange excerpted therein, suggests that the intent of the HTML 5 spec is that type=hidden inputs should not be labelable. This makes sense to me, since the intent is to pass focus from the label to the labeled element, but I do think the spec could benefit from some clarification.

In particular, according to http://www.w3.org/TR/html5/forms.html#the-label-element, one can label any &quot;labelable form-associated element&quot;, one of which is &quot;input&quot;. I couldn&apos;t find any exceptions to this, for example at http://www.w3.org/TR/html5/states-of-the-type-attribute.html#hidden-state.

Perhaps we could add something along the lines of &quot;input (with a type attribute having a value other than hidden)&quot; to the section at http://www.w3.org/TR/html5/forms.html#category-label :

Labelable elements
    Denotes elements that can be associated with label elements.
        button input keygen meter output progress select textarea

...and also a note in http://www.w3.org/TR/html5/states-of-the-type-attribute.html#hidden-state .

Thoughts?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>38577</commentid>
    <comment_count>1</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2010-09-07 23:58:40 +0000</bug_when>
    <thetext>EDITOR&apos;S RESPONSE: This is an Editor&apos;s Response to your comment. If you are satisfied with this response, please change the state of this bug to CLOSED. If you have additional information and would like the editor to reconsider, please reopen this bug. If you would like to escalate the issue to the full HTML Working Group, please add the TrackerRequest keyword to this bug, and suggest title and text for the tracker issue; or you may create a tracker issue yourself, if you are able to do so. For more details, see this document:
   http://dev.w3.org/html5/decision-policy/decision-policy.html

Status: Partially Accepted
Change Description: see diff given below
Rationale: I added this constraint and noted it in the definition of &quot;labelable&quot;. I didn&apos;t note it anywhere else so far, because the same constraint for &quot;Interactive content&quot; wasn&apos;t mentioned there either.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>38578</commentid>
    <comment_count>2</comment_count>
    <who name="">contributor</who>
    <bug_when>2010-09-07 23:59:41 +0000</bug_when>
    <thetext>Checked in as WHATWG revision r5432.
Check-in comment: Disallow &lt;label&gt; to be used with &lt;input type=hidden&gt;.
http://html5.org/tools/web-apps-tracker?from=5431&amp;to=5432</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>40341</commentid>
    <comment_count>3</comment_count>
    <who name="Erik Rose">erik</who>
    <bug_when>2010-10-01 00:05:14 +0000</bug_when>
    <thetext>Looks great. To be totally pedantic, I noticed a missing space after the colon in &quot;in the Hidden state:Listed&quot;. Thanks for the quick attention!</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>