Hi all,
I would like to prefill a date field with current date.
Is it possible?
Thank you in advance.
I would like to prefill a date field with current date.
Is it possible?
Thank you in advance.
Hi 2caffe,
Yes, you need to be careful about the date format you use though.
Drag a Custom Code action into the form On Load event and move it before the Show HTML action. Then add a code snippet like this to it replacing 'input_name' with the name of your input and 'Y-m-d' with the date format you need:
Bob
Yes, you need to be careful about the date format you use though.
Drag a Custom Code action into the form On Load event and move it before the Show HTML action. Then add a code snippet like this to it replacing 'input_name' with the name of your input and 'Y-m-d' with the date format you need:
<?php
$form->data['input_name'] = date('Y-m-d');
?>
Bob
This topic is locked and no more replies can be posted.