I dont know why my script is not working. I tried to get value of textbox in javascript but its not giving me a value. Value is shown as null.
//This is the code for my textbox
<td> <input id="demo3" type="text" size="25" runat="server"/><a href="javascript:NewCal('demo3','ddmmmyyyy',true,24)">
<img src="Resources/cal.gif" width="16" height="16" border="0" alt="Pick a date"></a> </td>
//This is how I trid to access textbox
exDateTime = document.getElementById('pCtrl').value;
but exDateTime is remains null.
I tried using other ways too, but nothing seen happening..
I don’t think you are referring to the proper id.
Try
document.getElementById("demo3").valueOr atleast paste the code where your “pCtrl” form field is.
EDIT : Make sure you set the value for the text box in html or using Javascript for example:
and then use
document.getElementById("demo3").valueto get the value, otherwise use javascript to assign the value and obtain the value at a later stage using the same.I hope this helped you.