How to get the date in textbox using JQuery

Advertisement
In this article we can able to see how to get the date with hours and minutes using JQuery.
We have to display the date, hours and minutes without any special characters.
Refer the JS file and use the below script.
Example:DDMMYYHHMM
  
<script>
var sp=new Date();
var day=sp.getDate();
var month=sp.getMonth()+1;
var year=sp.getFullYear();
var hour=sp.getHours();
var minute=sp.getMinutes();
var ddmmyy=day+""+month+""+year+""+hour+""+minute;
$("input[title^='DateField']").val(ddmmyy);
});
</script>

OutPut:




SharePoint Online Real Time Training Contact: JLAKSHMITULASI@GMAIL.COM
Advertisements
SHARE

Lakshmi Tulasi Jasti

  • Image
  • Image
  • Image
  • Image
  • Image
    Blogger Comment
    Facebook Comment

0 comments:

Post a comment