Welcome Guest, Not a member yet? Register   Sign In
A Database Error Occurred You must use the "set" method to update an entry.
#10

[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>&lt;input name="lastname" type="text" id="lastname" size="30" maxlength="255" value="&lt;?=$lastname?&gt;" class="&lt;?=$v-&gt;lastname_error?&gt;" ></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>&lt;input type="text" name="title" value="" id="title" class="field_error" /&gt;&lt;/p>


in my HTML code I've

<td>&lt;input name="lastname" type="text" id="lastname" size="30" maxlength="255" value="" class="" &gt;&lt;/td>


Messages In This Thread
A Database Error Occurred You must use the "set" method to update an entry. - by El Forum - 03-15-2009, 02:51 PM



Theme © iAndrew 2016 - Forum software by © MyBB