I am working on customizing the sharepoint list form (newform.aspx). So soon as the user opens the new form I want the Odate coloumn (date and time) to be filled automatically with the current date and time and get disabled. It is taking the current date but I am not sure how to set the time. Below is the code, any suggestions?
$(document).ready(function() {
var date = new Date();
var datinformat = date.getMonth()+1 + "/" + date.getDate() + "/" + date.getFullYear();
$("input[title ='Origin Date']").val(datinformat);
$("input[title='Origin Date']").attr('disabled','disabled');
[Update]: Hi Eric, when i changed default value of the field to today -It shows hour properly,but in the minutes section is shows 0 even if it is 15 mins or any number
- and from the image when when i change the setting of the date field to include the time as well from the image i got hour and mins dropdwn...but even if the Odate field is disable the hour and mins dropdown still remain selectable..any suggestions