I\'ve got a date text field I wish to only sometimes attach a DatePicker to, because I have some of my own text-handling scripts which handle partial date strings.
depending on your situation, you could do it server side
Ex. in asp-like sytax
<% if( showDatePicker ) {%>
$('#dp-div').DatePicker(); // or whatever
<% } %>
Edit
How about setting the dateFormat of the datepicker?
ie
$( ".selector" ).datepicker({ dateFormat: 'yy-mm-dd' });
you might be wanting
$( ".selector" ).datepicker({ dateFormat: '...' });