SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Evangelist
    Join Date
    Aug 2005
    Posts
    574
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Having trouble validating label for

    I have this code:
    PHP Code:
    <tr>
        <td class="checkPageLabel"><label for "insuranceCompanyName<?php echo $insuranceCount?>">Company Name: </label></td>
        <td style="border-right:none; ">
        <select onChange="newFlsOnSelectChange(this,'insuranceCompanyFD')" name="f_addClientIns[<?php echo $insuranceCount?>][companyID]" class="search" id="insuranceCompanyName<?php echo $insuranceCount?>">
            <option selected="selected" value="">Select</option>
            <option value="0">Add New Company</option>
                    <?php
                    $insuranceCompanies 
    insurance_listAll();
                    
                    for(
    $i 0$i count($insuranceCompanies); $i++)    {
                    
    ?>
            <option value="<?php echo $insuranceCompanies[$i]['companyID']?>"><?php echo $insuranceCompanies[$i]["insCompanyName"]; ?></option>
                    <?php
                    
    }            
                    
    ?>                
        </select>
        </td>
    </tr>
    Doctype is:
    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml"><head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    And I'm getting this validation error:
    Code:
    Line 326, Column 42: an attribute value literal can occur in an attribute specification list only after a VI delimiter.
    
    …td class="checkPageLabel"><label for "insuranceCompanyName0">Company Name: </
    
    ✉
    
    Have you forgotten the "equal" sign marking the separation between the attribute and its declared value? Typical syntax is attribute="value".
    The generated code looks like this, so the label and the id match up:
    Code:
    <tr>
    	<td class="checkPageLabel"><label for "insuranceCompanyName0">Company Name: </label></td>
    	<td style="border-right:none; ">
    	<select onchange="newFlsOnSelectChange(this,'insuranceCompanyFD')" name="f_addClientIns[0][companyID]" class="search" id="insuranceCompanyName0">
    		<option selected="selected" value="">Select</option>
    		<option value="0">Add New Company</option>
    		<option value="1">Aetna</option>
    		<option value="4">asdas</option>
    		<option value="2">Blue Cross</option>
    		<option value="3">UBH</option>
    		<option value="5">UBH</option>
    	</select>
    	</td>
    </tr>
    Any ideas about what's wrong?


    I'm getting the same error message here. I thought the error might have been caused by the PHP but there's no PHP in this section:
    Code:
    <tr>
    	<td class="checkPageLabel"><label for"companyName">Company Name: </label></td>
    	<td class="checkPageValue" id="insuranceInput" style="border-right:none;"><input type="text" id="companyName" name="f_insuranceCompany[insCompanyName]" value="" /></td>				
    </tr>
    Last edited by tryin_to_learn; Aug 25, 2007 at 19:03. Reason: Added second failed validation

  2. #2
    SitePoint Member potsed's Avatar
    Join Date
    Jan 2005
    Location
    ZA
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Quite simple really

    Code:
    <label for "insuranceCompanyName<?php echo $insuranceCount; ?>">
    should be

    Code:
    <label for="insuranceCompanyName<?php echo $insuranceCount; ?>">
    Take a look here:

    http://www.w3schools.com/tags/tag_label.asp

  3. #3
    SitePoint Evangelist
    Join Date
    Aug 2005
    Posts
    574
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Oh golly! I really didn't know that. Thank you so much. I don't know how I was overlooking that but I was.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •