Friday, July 6, 2007

Set Datetime field using Javascript

Here is the code to set the date and time of a datetime field using Javascript. You can put this into your onLoad event handler.

var today = new Date( );
today.setHours(14);
today.setMinutes(00);
crmForm.all.new_datefield.DataValue = today;

No comments: