[eluser]polaris1927[/eluser]
Hi,
I would like to know how I can validate an array field.
The contact_number needs to be an array of phone numbers and in my view code, I use a for loop to display the array contents.
My problem is how to define the
Code:
$fields['contact_number']
in the validation code.
Below is my code that does not work:
My Controller has the following code:
Code:
$fields['contact_number[]'] = "phone number";
My view has the following:
Code:
<?php for($i=0; $i < 5; $i++): ?>
<tr>
<td width="10%" style="text-align: center;"><?php echo $i + 1; ?></td>
<td width="59%"><?php echo $this->formatnumber->format( $this->validation->contact_number[$i] ); ?></td>
<td width="10%"></td>
<td width="10%"></td>
</tr>
<?php endfor; ?>