Hello,
Can anyone help me with an example on how to set the default value of a datetime field to now so that when the add form is opened the current date time is set?
Thanks,
Hello,
Can anyone help me with an example on how to set the default value of a datetime field to now so that when the add form is opened the current date time is set?
Thanks,
Hello @markab and welcome to our forums ![]()
You can use: callbackAddForm for add form and callbackEditForm for edit form.
The documentation also has an example so I guess it will be straight forward. Let me know if that worked for you.
Regards
Johnny
Thanks…
$crud->callbackAddForm(function ($data) {
$data['san_created_date'] = date('d/m/Y H:i:s');
return $data;
});
| Topic | Replies | Views | Activity | |
|---|---|---|---|---|
| [RESOLVED] Updated Grocery CRUD Enterprise from 3.2.4 to 3.2.7 |
|
1 | 842 | Jan 14 |
| The “uniqueFields” function only throws an error in English |
|
0 | 847 | Jan 19 |
| Custom validation functions |
|
0 | 727 | Jan 22 |
| Function fieldType with parameter ‘multiselect_searchable’. and groupFields |
|
1 | 543 | Apr 9 |
| setRule - Validate doesn’t support more than 3 parameters |
|
0 | 603 | Feb 23 |