title: JqueryUI Datepicker: Uncaught TypeError: Cannot read property 'settings' of undefined?
body: <p>I am developing a asp.net MVC4 project where i use lots of JqueryUI datepicker.</p>
  
  <p>For one of my date picker when i tried to click on datepicker image i am getting some error like,</p>
  
  <pre><code>Uncaught TypeError: Cannot read property 'settings' of undefined                jquery-ui-1.10.3.min.js:9
  </code></pre>
  
  <p>Html </p>
  
  <pre><code>&lt;div&gt;
  &lt;input type="text" id="tsDte"  style="font-size: 14px;width: 50%" &gt;              
                  &lt;img src="~/Images/dayPicker.png" onclick="tsDatePickerClick()" style="vertical-align:bottom"/&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>Javascript</p>
  
  <pre><code>var currentDate = new Date();
  
  $("#tsDte").datepicker({
      dateFormat: 'yy-mm-dd',
      maxDate: 0,
      changeYear: true 
  }).attr('readonly', 'readonly');
  $("#tsDte").datepicker("setDate", currentDate);
  
  
  function tsDatePickerClick() {
      $("#tsDte").datepicker('show');
  }
  </code></pre>
  
  <p>Here i have a Textfield and a datepicker image.When i click on datepicker image datepicker will popup .</p>
  
  <p>i have followed the similar way in other datepicker and they are working fine.I have only problem with this date picker.</p>
  
  <p>Any help is appreciated.</p>