Jump to content


Unable to call readonly fields from callback_before_update as post parameters

callback_before_update field_type readonly

  • Please log in to reply
No replies to this topic

#1 pdevyani

pdevyani

    Newbie

  • Members
  • Pip
  • 1 posts

Posted 12 September 2019 - 07:56 AM

If I define a field to be readonly, I am unable to call it as a post parameter in callback_before_update function.

 

Please see the example below: 

 

$this->crud->fields('user_id','name','address', 'phone', 'city', 'age');

$this->crud->columns('user_id','name','address', 'phone', 'city', 'age');

 

$this->crud->field_type('user_id', 'readonly');

 

$this->crud->callback_before_update(array(
                $this,
                '_update_user_info',
            ));

 

public function _update_user_info($post_array){

//further processing with post_array

 

//since i have defined 'user_id' as a readonly field, I am unable to read its value as a post parameter here. 

How do I access readonly fields in this function ? If I comment the line $this->crud->field_type('user_id', 'readonly'); it works correctly. 

 

}







Also tagged with one or more of these keywords: callback_before_update, field_type, readonly

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users