Welcome Guest, Not a member yet? Register   Sign In
Editing unique data post input.
#1

I am using the set rules for the form validation.
All is okay but when editing a page it says the slug is taken {of course it is, it belongs to the post I'm editing} but I need it there still obviously because I'm trying to prevent it being shared with another. Anybody have any suggestions as a work around?

PHP Code:
public function set_rules()
    {
        
$config = array(
            array(
                
'field' => 'title'
                
'label' => 'Title'
                
'rules' => 'trim|min_length[5]|required|xss_clean'
            
),
            array(
                
'field' => 'slug'
                
'label' => 'Slug'
                
'rules' => 'trim|min_length[5]|is_unique[pages.slug]|alpha_dash|required|xss_clean'
            
),
            array(
                
'field' => 'order'
                
'label' => 'Order'
                
'rules' => 'trim|numeric|required|xss_clean'
            
),
            array(
                
'field' => 'body'
                
'label' => 'Body'
                
'rules' => 'trim|min_length[5]|required|xss_clean'
            
)
        );
        
$this->form_validation->set_rules($config);
    } 
Reply


Messages In This Thread
Editing unique data post input. - by miiikkeyyyy - 03-02-2015, 06:33 PM
RE: Editing unique data post input. - by obiron - 03-03-2015, 01:24 AM



Theme © iAndrew 2016 - Forum software by © MyBB