This forum is no longer open and is for reading/searching only.
Please use our new MachForm Community Forum instead.
MachForm Community Forums » MachForm 2
submit date admin only
Started 15 years ago by jflatham | 4 posts |
-
Is there a way to add a date field, admin only, to a form that will automatically place the submission date (usually today's date) into the database on the date the form is submitted?
Posted 15 years ago # -
Do you want to set default value for "date" field ? if it's so you should edit "view-functions.php" file. Go to around line 364, you'll find this code in there :
$element_markup = <<<EOT
put these code above that line
if ($element->id == 10) { $element->populated_value['element_'.$element->id.'_1']['default_value'] = date('m'); $element->populated_value['element_'.$element->id.'_2']['default_value'] = date('d'); $element->populated_value['element_'.$element->id.'_3']['default_value'] = date('Y'); }
I assume your "date" admin field have id = 10, it should give default value to that field. Anyway I'm curious why you do not use "date_created" field instead ? machform has that field by default in every form.
MachForm Support
Posted 15 years ago # -
Where is the setting for the date to be on every form. I can not find it?
Posted 15 years ago # -
You can see "Date Created" field on "entries" menu, if you can't see it, click "choose columns" and select the field from there.
MachForm Support
Posted 15 years ago #
Reply
You must log in to post.