I am trying to get the date time picker value from java script, but can't get. After I get the value , I need to pass them to another class.
<apex:form id="form1">
<apex:pageBlock title="Report">
<table border="0" style="border-collapse: collapse;" width="100%">
..
<tr>
<td valign="middle" width="7%">
<apex:inputText id="startDate" value="{!startDate}" onfocus="DynamicDatePicker(this);"
</apex:form>
My JS,
function goToDetail(Id)
{
var startDate = document.getElementById(VF_MyPage:form1:startDate).value;
(or)
var startDate = document.getElementById('{!$Component.form1.startDate}').value;
...
}
both JS couldn't work to get the value. Getting error of [Empty string passed to getElementById()] , document.getElementById(...) is null ].
And when I view the frame source, here is the level . j_id0:j_id6:VF_MyReportform1:j_id187:startDate