You have several options to accomplish this:
You can use the server side object model by creating an event receiver that fires on the item added/adding event. The following code will accomplish changing the field value:
var thisItem = properties.ListItem;
var date = DateTime.Parse(thisItem["DueDate"].toString());
thisItem["RevisedDueDate"] = date;
thisItem.Update();
You can use JavaScript to set the value of the revised due date within the PreSaveFunction()
. To do so, just modify the newform for the list, and add this to a content editor web part:
function PreSaveAction() {
var revised = $("input[title='Revised Due Date']");
if(!revised.value())
revised.value($("input[title='Due Date']").val());
return true;
}
If either field is a required field, then append the title with: " Required Field" (note the space in front of Required Field). So if Due Date was required, it you would use the following selector: $("input[title='Due Date Required Field']")
If you cannot use JavaScript or use Server Side code, then you can use a workflow that runs when an item is created to set the value of Revised Due Date
.