2013-06-25 5 views
2

간단한 HTML5 형식이 있습니다. 하지만 코드 검사기 (http://validator.w3.org/check)를 할 때 여러 개의 오류가 발생합니다.레이블이있는 HTML5 유효성 검사 양식

for the label 요소의 속성은 양식 컨트롤을 참조해야합니다. 이 오류는 무엇을 의미합니까? 그것은이 라인

<label id="name0" for="Name" style="width: 180px;">Name</label> 

이 폼 컨트롤의 ID 여야합니다 내 현재 양식

<div id="contact-add" title="Add New Contact" style="display: none;"> 

     <div id="response-add"></div> 
     <form method="post" id="add-form"> 

     <div class="label-input"> 
      <label id="name0" for="Name" style="width: 180px;">Name</label> 
      <input type="text" id="fullname0" value="" name="name" placeholder="Enter full name..." /> 
      <input type="hidden" name="add_account_id" id="add_account_id" value="<?php echo $add_account_id; ?>" /> 

     </div> 

     <div class="label-input"> 
      <label id="title0" for="title" style="width: 180px;">Title (Optional)</label> 
      <input type="text" value="" name="title" placeholder="Enter title here..." /> 
     </div>  

     <div class="label-input"> 
      <label id="email0" for="email" style="width: 180px;">Email (Optional)</label> 
      <input type="text" value="" id="email" name="email" placeholder="Enter email address..." /> 
     </div> 


     <div class="label-input"> 
      <label id="phone0" for="phone" style="width: 180px;">Direct Number (Optional)</label> 
      <input type="text" value="" id="phone_number" name="phone_number" placeholder="Enter direct number..." /> 
     </div>   
     <div class="label-input"> 
      <label id="extention0" for="extention" style="width: 180px;">Extention (Optional)</label> 
      <input type="text" value="" id="phone_ext" name="phone_ext" placeholder="Enter extention number..." /> 
     </div> 

     <div class="label-input"> 
      <label id="shift0" for="shift" style="width: 180px;">Work Shift</label> 
      <?php echo generateWorkShiftMenu($db, 'work_shift', 'Day'); ?> 
     </div> 


     </form> 
</div> 
+2

가능한 중복 : http://stackoverflow.com/questions/5137628/html5-validation-form-tag – showdev

답변

1

라벨의 for 속성입니다 가리키고 있습니다. 즉

<label id="name0" for="fullname0" style="width: 180px;">Name</label> 
<input type="text" id="fullname0" value="" name="name" placeholder="Enter full name..." /> 
+0

감사합니다. 그것이 문제였습니다. – Mike