I tried the below code.
$currentDate = date(strtotime(time()));
$date = new DateField('date');
$date->setLabel($this->text('enquiry','enquiry_start_date'));
if(isset($_SESSION["session1"]))
{
$date->setValue($currentDate);
}
$form->addElement($date);
But When I see the form in the front end, The current date is not chosen.
How to do this?
I think this is not a custom code modification. Moderators Please explain if you think this is a custom code modification.