[eluser]PV-Patrick[/eluser]
Hello,
I have been searching around here for hours trying to figure this problem out and I can't seem to fix it. In a nutshell, when I click submit to validate my form and it doesn't pass, I don't see the error's at all on the view.
Code:
<?php
class Products extends Controller {
function Products() {
parent::Controller();
$this->load->database();
$this->load->helper(array('form','url'));
$this->load->library('validation');
}
function index() {
$data['title'] = "Title";
$this->load->view('products', $data);
}
function order() {
$data['title'] = "Title";
$this->load->view('order', $data);
}
function product_order() {
$rules['firstname'] = "required|trim|min_length[2]|max_length[25]|alpha_dash";
$rules['lastname'] = "required|trim|min_length[2]|max_length[25]|alpha_dash";
$this->validation->set_rules($rules);
$fields['firstname'] = 'First Name';
$fields['lastname'] = 'Last Name';
$this->validation->set_fields($fields);
if($this->validation->run() == FALSE) {
$this->load->view('order');
} else {
$this->load->view('formsuccess');
}
}
}
?>
This is a stripped version of the view page.
Code:
<?=$this->validation->error_string; ?>
<?=form_open('products/product_order', $form_attributes);?>
<table>
<tr>
<td><u>Billing Information</u></td>
</tr>
<tr>
<td>First Name:</td>
<td><input type="text" name="firstname" size="20" maxlength="25" onClick="loadData(<?=$user_form_data?>)"></td>
<td>Last Name:</td>
<td><input type="text" name="lastname" size="20" maxlength="25"></td>
</tr>
<tr>
<td><?=form_submit('submit_order', 'Submit');?></td>
</tr>
</table>
</form>
Any help would be appreciated, thanks!