In enterprise version fieldType hidden how to add default value on input?

How to add default value when use fieldType in enterprise? In other version works like this

$crud->field_type('status', 'hidden', 'ACTIVE');

example but in the new version not working.

1 Like

Doc :

Hope it’s useful.

2 Likes

Hello @barrcode ,

You should use: callbackAddForm and/or callbackEditForm instead.

For example in your case you should do something like this:

$crud->field_type(‘status’, ‘hidden’);
$crud->callbackAddForm(function ($data) {
    $data['status'] = 'ACTIVE';

    return $data;
});

$crud->callbackEditForm(function ($data) {
    $data['status'] = 'ACTIVE';

    return $data;
});
2 Likes

nice really thank u, Johnny

1 Like