I am new on HMVC Codeigniter.I would use the codeigniter for form validation on HMVC format of codeigniter but it does not show any effect that means formvalidation not work on my project. But this code should be work on MVC codeigniter. So please help me to solve this problem in my project.I am greatful who help to solve this problem in my project.
** I have an associative controller file feedback.php as below**
function index($offset=0){
$this->load->helper('url');
$this->load->helper('form');
$this->load->library('form_validation');
$this->form_validation->set_rules('name','Name','trim|required');
$this->form_validation->set_rules('email','Email Address','trim|valid_email|required');
$this->form_validation->set_rules('message','Message','trim|required');
if($this->form_validation->run()){
$data1=array(
'name' => $this->input->post("name"),
'email' => $this->input->post("email"),
'message' => $this->input->post("message"),
);
}
}
$data=array('body1'=>'feedback');
$this->load->view('temp',$data);
}
I have an associative view file feedback.php as below
<form action="<?php echo site_url()?>" name="FeedbackForm" method="post">
<span style="color:#F00">
<?php echo validation_errors(); ?>
</span>
<table>
<tr>
<td><label>Name</label></td>
<td><input id="name" name="name" type="text" /></td>
</tr>
<tr>
<td><label>Email</label></td>
<td><input type="email" name="email" id="email" /></td>
</tr>
<tr>
<td><label>Message</label></td>
<td><textarea name="message" rows="2" cols="16" ></textarea></td>
</tr>
<tr>
<td></td>
<td><input type="submit" id="submit" value="Send" /> </td>
</tr>
</table>
</form>