[eluser]Civic[/eluser]
Hi, I am a newbie in CodeIgniter. Can I place a validation in a form_input? Because in the examples in the forums, the view uses html tags while I used echo form_input($field_id).
Where model index is;
$data[’field_id’] = array(’field_id’=>’field_id’,’maxlength’=>8,’size’=>8);
Where controller index is;
$this->load->view(’module1/add’,$data);
Where add view is;
<?php
$attributes = array('name' => 'addView', 'id' => 'addView');
echo form_open('modules/add',$attributes);
?>
<?php echo form_input($field_id);?>
<?php echo form_close();?>
How do I add?
$rules[’field_id’] = “required”;
$this->validation->set_rules($rules);
Thanks in advance..