<p>How do I use the jQuery Datepicker with a textbox input:</p>

<pre><code>$("#my_txtbox").datepicker({
  // options
});
</code></pre>

<p>that doesn't allow the user to input random text in the textbox.
I want the Datepicker to pop up when the textbox gains focus or the user clicks on it, but I want the textbox to ignore any user input using the keyboard (copy &amp; paste, or any other). I want to fill the textbox exclusively from the Datepicker calendar.</p>

<p>Is this possible?</p>

<p>jQuery 1.2.6<br/>
Datepicker 1.5.2</p>

You should be able to use the
readonly
attribute on the text input, and jQuery will still be able to edit its contents.
```
```
<input type='text' id='foo' readonly='true'>
```
```