Default values for custom fields?

First off, the support here is terrific! I’m making good progress with the docs and forum.

I’ve got two custom fields on the date entry form. I’d like to pre-populate one that is a textbox with the WordPress user name and another with a date. I’ve been digging around and I can’t see where I need to make this change.

When the custom fields get added I see the added columns in the MySQL table but I haven’t found where they are in a PHP or CSS file.

Thanks again.

codebase/dhtmlxSchedulerConfigurator.php

locate method schedulerInit ( around line 800 )

and replace the end of it

return $scheduler; }

as

$scheduler .= " scheduler.attachEvent('onEventCreated', function(id){ scheduler.getEvent(id).some_field = '{$some_value}'; return true; }); "; return $scheduler; }

where some_field - name of your custom field ( lower case! )
some_value - php value , which you want to use as default value for that field.

Found and added. I end up with a line of text below the calendar:

scheduler.attachEvent(‘onEventCreated’, function(id){ scheduler.getEvent(id).user_name= ‘’; return true; });

The custom field is not showing a value.

Thanks.

You need to replace $some_value with var which stores info in question - if it is empty - it means the var is empty or its name is incorrect.