title: Jquery add datepicker to input fields
body: <p>I am using the jquery datepicker on a number of text input fields in my forms. I typically bind it to the input(s) as follows:</p>
  
  <pre><code>$(function() {
    $("#date_due").datepicker();
  });
  </code></pre>
  
  <p>In certain circumstances, the id of the field that I am referencing may not be an input field, but I still want to use the same ID and I dont want the datepicker to be available.</p>
  
  <p>I have tried the following, but it doesnt seem to work (i.e. the datepicker does not appear at all):</p>
  
  <pre><code>$(function() {
    $("#date_due :input").datepicker();
  });
  </code></pre>
  
  <p>Or, put another way, I only want the datepicker to be used if the field is a form text input.</p>