3

I am new to Drupal. I need to set a default value to a date field. Please anyone help me on this. Thanks.

2

Please see below code to set a default value for date field using hook_form_alter

$form["your_date_field"]["und"][0]['#default_value']['value'] = '2016-11-16 00:00:00';
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.