如何选择特定的自定义字段

im trying to select a custom field in this case the 10th field so i can change the input type from text to date, but i not quite sure how to accomplish this, here is my code.

<?php for ($i = 0; $i < 11; $i++) 
{ 
 ?>
<?php
if($this->config->item('custom'.$i.'_name') != NULL)
{
    $item_arr = (array)$item_info;
    ?>
    <div class="field_row clearfix">
        <?php   
        echo form_label($this->config->item('custom'.$i.'_name').':', 'custom'.$i,array('class'=>'wide')); ?>
        <div class='form_field'>
            <?php echo form_input(array(
                'name'=>'custom'.$i,
                'id'=>'custom'.$i,
                'value'=>$item_arr['custom'.$i])
            );?>

        </div>
    </div>
    <?php 
}

}

?>

i have 10 custom fields, i select 10th cause i need to set date picker (right now i got the form_password) , i tried this but well the 10th shows but doesn't work as desire, syntaxis errors and it outputs all 10 fields and not the ones i selected only as example

<?php for ($i = 0; $i < 11; $i++) 
{ 
 ?>
<?php
if($i < "9")
{
    $item_arr = (array)$item_info;
    ?>
    <div class="field_row clearfix">
        <?php   
        echo form_label($this->config->item('custom'.$i.'_name').':', 'custom'.$i,array('class'=>'wide')); ?>
        <div class='form_field'>
            <?php echo form_input(array(
                'name'=>'custom'.$i,
                'id'=>'custom'.$i,
                'value'=>$item_arr['custom'.$i])
            );?>

        </div>
    </div>
    <?php 
}

else {

     echo form_password(array(
                'name'=>'custom'.$i,
                'id'=>'custom'.$i,
                'value'=>$item_arr['custom'.$i])
            );

}

}