Error: 'this._targetEl.value.length' is null or not an object ASP.NET
<p>I'm trying to bind the selected value from the date picker to an asp textbox but I have this Error: 'this._targetEl.value.length' is null or not an object. </p>

<p>Here's the code: </p>

<pre><code>&lt;InsertItemTemplate&gt;
    Book Title:
    &lt;asp:DropDownList ID="DropDownList1" runat="server" 
        DataSourceID="booktitleDataSource" DataTextField="booktitle" 
        DataValueField="bookid" SelectedValue='&lt;%# Bind("bookid", "{0}") %&gt;'&gt;
    &lt;/asp:DropDownList&gt;
    &lt;asp:SqlDataSource ID="booktitleDataSource" runat="server" 
        ConnectionString="&lt;%$ ConnectionStrings:LibrarySystemConnectionString %&gt;" 
        SelectCommand="SELECT [bookid], [booktitle] FROM [TblBooks]"&gt;
    &lt;/asp:SqlDataSource&gt;
    &lt;br /&gt;

    Employee PIN:
    &lt;asp:TextBox ID="employeeidTextBox" runat="server" 
        Text='&lt;%# Bind("employeeid") %&gt;' /&gt;
    &lt;br /&gt;

    Department:
    &lt;asp:TextBox ID="departmentTextBox" runat="server" 
        Text='&lt;%# Bind("department") %&gt;' /&gt;
    &lt;br /&gt;

    Date borrowed:
    &lt;asp:TextBox ID="dateborrowedTextBox" runat="server" Text='&lt;%# Bind("dateborrowed") %&gt;' /&gt; 
&lt;%--&lt;input type="text" name="dateborrowedTextBox" readonly="readonly" id="dateborrowedTextBox"&gt;--%&gt; 
    &lt;a href="#" onclick="cdp1.showCalendar(this, 'dateborrowedTextBox'); return false;"&gt;Date Picker&lt;/a&gt;       
    &lt;br /&gt;

    &lt;asp:Button ID="InsertButton" runat="server" CausesValidation="True" 
        CommandName="Insert" Text="Insert" /&gt;
    &lt;asp:Button ID="InsertCancelButton" runat="server" CausesValidation="False" 
        CommandName="Cancel" Text="Cancel" /&gt;
&lt;/InsertItemTemplate&gt;
</code></pre>

<p>It was working when I 
tried using <code>&lt;input type="text" name="dateborrowed" readonly="readonly" id="dateborrowedTextBox"&gt;</code> but when I tried using the asp:TextBox I cant pass the selected value from date picker to the textbox. So where did I go wrong? Is there a way to program the date picker link to call the popup calendar? (its in Java btw)</p>

<p>Help would be much appreciated! 
Thanks in advance.</p>
