Hello,
I have a dropdown list with choices 'choices' , how could i show another field that is a textbox named 'textbox' when user selects 'C' choice in ADD and EDIT forms ?
$crud->field_type('choices','dropdown', array(
'A' => 'A',
'B' => 'B',
'C' => 'C',
'D' => 'D'
));
My approach is trying to hide the field 'textbox' when 'choice' is NOT 'C'
I tried the following in Main.php, but it does not work.
if ($crud->getState() == 'edit') && ($crud->getState() == 'add')
{
$field_value = $crud->get_edit_field_value('choices');
if ($field_value != 'C'){
$crud->field_type('textbox', 'hidden');
}
};
Your help will be much appreciated.
Thank you,
