[eluser]il_dandi[/eluser]
Now it's OK!!! I missed the render!!
Now I've only 2 problems:
How Can I manage the validation... I would like apply CSS on the textbox and combobox border
Code:
function add()
{
$this->load->helper('form');
$data['tipo']="aggiungi";
if ( ! $this->_validate_form() )
{
$this->template->write_view('content', 'admin/avatar', $data, TRUE);
$this->template->render();
}
else
{
$id = $this->avatars_model->add_entry();
$this->session->set_flashdata('msg', 'OK');
redirect(base_url()."admin/avatars");
}
}
function _validate_form()
{
$rules = array(
'firstname' => 'trim|required|strip_tags|xss_clean|max_length[30]',
'lastname' => 'trim|strip_tags|xss_clean|max_length[500]'
);
$this->validation->set_rules($rules);
$fields = array(
'firstname' => 'fistname',
'lastname' => 'lastname',
'age' => 'age'
);
$this->validation->set_fields($fields);
return ($this->validation->run() == FALSE) ? FALSE : TRUE;
}
in the view I have
Code:
<?php $v =& $this->validation ?>
...
<td align="right">cognome: </td><td><input name="lastname" type="text" id="lastname" size="30" maxlength="255" value="<?=$lastname?>" class="<?=$v->lastname_error?>" ></td>
</tr>
...
I would like to apply a CSS ... in linkster I've seen this solution
how can I apply the CSS?? In HTML code of linkster example I've
<p><label for="title">* Title: </label><input type="text" name="title" value="" id="title" class="field_error" /></p>
in my HTML code I've
<td><input name="lastname" type="text" id="lastname" size="30" maxlength="255" value="" class="" ></td>