Javascript and clientId issue
<p>Hi guys I have a user control:</p>

<pre><code>&lt;input type="text" id="datepicker" runat="server" readonly="readonly" /&gt;
 &lt;img src="../images/remove.png" id="test" onclick="ClearFeild()" runat="server" /&gt;
</code></pre>

<p>My aspx page looks like this:</p>

<pre><code>&lt;asp:Content ID="Content3" ContentPlaceHolderID="ContentPlaceHolderBody" runat="server"&gt;

    &lt;uc:Calendar ID="calSample" runat="server" ChangeMonth="false" ChangeYear="false"
        DateFormat="dd-M-yy" TextBoxWidth="75px" Enabled="true" /&gt;
    &lt;uc:Calendar ID="Calendar1" runat="server" ChangeMonth="false" ChangeYear="false"
        DateFormat="dd-M-yy" TextBoxWidth="75px" Enabled="true" /&gt;
&lt;/asp:Content&gt;
</code></pre>

<p>And on the user control I have a javascript function that gets called on the img onclick:    </p>

<pre><code>    function ClearFeild()
    {     
       debugger; 
       $("#&lt;%=datepicker.ClientID %&gt;").val() = "";
    }
</code></pre>

<p>but the value of </p>

<blockquote>
  <p>$("#&lt;%=datepicker.ClientID %>");</p>
</blockquote>

<p>is always :</p>

<blockquote>
  <p>$("#ContentPlaceHolderBody_Calendar1_datepicker");</p>
</blockquote>

<p>which is the second user control, even though i click on the first control.</p>

<p>PLease assist as to how i can over come this.</p>

<p>The CLearFeild function gets called on a button click to clear the datepicker feild.</p>

<p>Kind regards.</p>
