Welcome Guest, Not a member yet? Register   Sign In
Help in Form Helpers using Validation Class
#1

[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..


Messages In This Thread
Help in Form Helpers using Validation Class - by El Forum - 07-10-2008, 10:10 PM
Help in Form Helpers using Validation Class - by El Forum - 07-11-2008, 01:20 AM
Help in Form Helpers using Validation Class - by El Forum - 07-11-2008, 01:29 AM
Help in Form Helpers using Validation Class - by El Forum - 07-11-2008, 03:10 AM
Help in Form Helpers using Validation Class - by El Forum - 07-11-2008, 05:26 AM



Theme © iAndrew 2016 - Forum software by © MyBB