Skip to main content
Tweeted twitter.com/#!/StackSharePoint/status/165355455978283008
Updates to questions based on the answers
Source Link
SandeshR
  • 2k
  • 17
  • 67
  • 115

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]: enter image description here 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

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');

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]: enter image description here 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
deleted 4 characters in body; edited title
Source Link
Eric Alexander
  • 43.3k
  • 10
  • 54
  • 93

setting current'current date time in sharepoint form field (newform.aspx) sharepoint 2010

Hi iI am working on customizing the sharepoint list form  (newform.aspx) ..so So soon as the user opens the new form iI want the Odate coloumn  (date and time) to be filled automatically with the current date and time and get disabled..it It is taking the current date but iI am not sure how to set the time..below Below is the code..any, any suggestions?

    $(document).ready(function() {
enter code here


  var date = new Date();
    var datinformat = date.getMonth()+1 + "/" + date.getDate() + "/" + date.getFullYear();

$("input[title ='Origin Date']").val(datinformat);

$("input[title ='Origin Date']").val(datinformat);

    $("input[title='Origin Date']").attr('disabled','disabled');

setting current' date time in sharepoint form field (newform.aspx) sharepoint 2010

Hi 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() {
enter code here


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');

setting current date time in sharepoint form field (newform.aspx) sharepoint 2010

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');
Source Link
SandeshR
  • 2k
  • 17
  • 67
  • 115

setting current' date time in sharepoint form field (newform.aspx) sharepoint 2010

Hi 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() {
enter code here


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');