how to preset field values in a ‘new record’ form

Archived from the Xataface Users forum.

xenajo — Tue Jul 05, 2011 7:41 am

Hi,

is it possible to preset somes field values in a ‘new record’ form ?
I would like to preset a calendar type field value with the current date, a select type field value with the name of the current user, and a checkbox type field value with a default value

thanks for your help


ADobkin — Tue Jul 05, 2011 8:21 am

xenajo,

This forum thread will help you with setting defaults field values in general using the fieldname__default delegate class function:

Pre-entered Data
http://xataface.com/forum/viewtopic.php?t=5028

This forum thread explains alternate methods to use specifically with a date/time field:

How to initialize a Date field to today’s date?
http://xataface.com/forum/viewtopic.php?t=4004

Lastly, this forum thread provides a solution to populate the current user:

Setting default select setting from users table
http://xataface.com/forum/viewtopic.php?t=3988

Alan


ADobkin — Tue Jul 05, 2011 8:49 am

FYI, I have created a new wiki page on this topic using Steve’s responses to the forum posts mentioned above.

http://xataface.com/wiki/fieldname__default

Alan