This project has moved and is read-only. For the latest updates, please go here.

Auto Populate a New Item Form text box with todays date

Dec 12, 2011 at 11:03 AM
Edited Dec 12, 2011 at 11:10 AM


I have created an external list called "All Changes" which has a text box field for the date the change was made.

As this is an External List which connects to SQL using BCS I am unable to go into the column and set default values.

When a user creates a new item I require the "date of change" box to default to todays date. The format needs to be yyyy-mm-dd e.g. 2011-12-12.

Is this possible using SPServices?

Thanks in advance for your help.


Code for my field:

<SharePoint:FormField runat="server" id="ff4{$Pos}" ControlMode="New" FieldName="changedate" __designer:bind="{ddwrt:DataBind('i',concat('ff4',$Pos),'Value','ValueChanged','ID',ddwrt:EscapeDelims(string('')),'@changedate')}"/>

Dec 12, 2011 at 12:13 PM


You don't need SPServices for this; you can do it with JavaScript or jQuery.