Thursday, October 27, 2011

Accessing Sharepoint DateTimeControl in Javascript

Hi Guys,

I thought it worth posting this on how to access the sharepoint DatetimeControl in case if you are creating custom webparts with this controls or writing some custom javascripts.

in javascript:


function GetDate()
{
var sdate=document.getElementbyId('<%=dateControlName.Controls[0].ClientID %>');
alert (sdate.value);
}

Cheers!