Welcome Guest, Not a member yet? Register   Sign In
dynamic inputs and validation
#4

[eluser]xwero[/eluser]
Normally it should work to validate an array but as the dynamic fields come out of a database why not do
Code:
<?php echo form_input('value_'.$howmany, set_value('value_'.$howmany)); ?> <?php echo form_error('value_'.$howmany); ?>
And in the controller
Code:
for($i=1;$1<=$data['howmany'];$i++)
{
   $this->form_validation->set_rules('value_'.$i,'Communication Value '.$i,'required');
}
Array validation is still a bit clunky even with the new validation class.


Messages In This Thread
dynamic inputs and validation - by El Forum - 05-09-2009, 11:23 PM
dynamic inputs and validation - by El Forum - 05-14-2009, 09:39 PM
dynamic inputs and validation - by El Forum - 05-15-2009, 02:45 AM
dynamic inputs and validation - by El Forum - 05-15-2009, 03:09 AM



Theme © iAndrew 2016 - Forum software by © MyBB